ziglang / zig.vim

Vim configuration for Zig
MIT License
466 stars 59 forks source link

l:path respects g:path if original l:path is empty #33

Closed faerryn closed 4 years ago

faerryn commented 4 years ago

As per @LemonBoy's suggestion in #32

The slowness you're seeing is probably due to the zig env being called at startup, the define/include changes should not affect anything beside the use of [i and [d. I've noticed that the very first call to env, when all the files are hashed, takes a few seconds on my machine.

This fixes the bug where path only includes the zig library, but fails to correctly append the C header files or the current working directory.

That was intentional, if you want to implement the local/global fallback I'd suggest something like this:

    let old_path=[&l:path, &g:path][empty(&l:path)]
    let &l:path=json_decode(s:env)['std_dir'] . ',' . old_path