zig.vim
zig.vim copied to clipboard
Plugin clobbers the path variable, breaking fuzzy finding
After opening a .zig file, line 40 of fplugin/zig.vim clobbers the path variable causing the vim fuzzy finder (:find) to start looking in the std lib directory instead of the cwd.
Seems like @LemonBoy added this behavior. I want to ask them what their intention was before thinking about removing it
I only added some more error checking around that logic, I guess whoever added that wanted gf to work on import statements.
@SamTebbs33 Did you try swapping, ie to write in ftplugin/zig.vim
let &l:path= &l:path . ',' . json_decode(s:env)['std_dir']
Vim/Neovim should then first look in the current path.
For anyone else impacted by this, you can fix it by altering line 47 in ftplugin/zig.vim (just swap the path priority)
Change it from:
let &l:path = g:zig_std_dir . ',' . &l:path
To:
let &l:path = &l:path . ',' . g:zig_std_dir