Skip to content

Commit 5fa8041

Browse files
author
dweiller
committed
Append g:zig_std_dir to &path
Using the local value of path means that is the user has not set a local value for path, the value of 'path' will just be 'g:zig_std_dir'. By using '&path' the current value of 'path' is used (i.e. if no local value is set the global one is used). For example, this means that if 'path' is at its default value of '.,/usr/include/,,' (which is not local) before loading the ftplugin, before this change the default value of path would be completely replace, making gf not find files files relative to the current file or directtory. With this change, gf will find imported files relative to the current file and directory by default. Appending 'g:zig_std_dir' rather than prepending means that zig files with the same name as ones in the standard library should be resolved to the one the project one is workinng on rather than the one in the standard library.
1 parent c33e1e3 commit 5fa8041

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ftplugin/zig.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if !exists('g:zig_std_dir') && exists('*json_decode') && executable('zig')
4444
endif
4545

4646
if exists('g:zig_std_dir')
47-
let &l:path = g:zig_std_dir . ',' . &l:path
47+
let &l:path = &path . ',' . g:zig_std_dir
4848
endif
4949

5050
let b:undo_ftplugin =

0 commit comments

Comments
 (0)