zig.vim icon indicating copy to clipboard operation
zig.vim copied to clipboard

Plugin clobbers the path variable, breaking fuzzy finding

Open SamTebbs33 opened this issue 4 years ago • 5 comments
trafficstars

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.

SamTebbs33 avatar May 16 '21 12:05 SamTebbs33

Seems like @LemonBoy added this behavior. I want to ask them what their intention was before thinking about removing it

haze avatar May 19 '21 19:05 haze

I only added some more error checking around that logic, I guess whoever added that wanted gf to work on import statements.

LemonBoy avatar May 19 '21 20:05 LemonBoy

@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.

matu3ba avatar Nov 03 '21 21:11 matu3ba

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

atemmel avatar Jan 20 '22 18:01 atemmel