Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current behaviour of the path option setting seems unintuitive to me: it ignores the global value of the path option, so any globally desired value of path (like the current directory/file) must be copied into the local local value in order files to be found anywhere outside the standard library. In particular this makes the default behaviour (i.e. if the user does not explicitly set a local value for
path
before the ftplugin is sourced) to not resolve files relative to the current file or directory (the default (global) value ofpath
does this). This change uses&path
instead of&l:path
to fix this, making the default behaviour work as (I think should be) expected.In addition, this change appends rather than prepends the standard library path - if a zig file does
@import("builtin.zig")
and there is a filebuiltin.zig
in the same directory, then the file being imported is (barring some extreme use ofmain-pkg-path
) that one, not the one in the standard library, so appending will make gf resolve it correctly with the defaultpath
option.