9
16
Fork
You've already forked zig.vim
2

Plugin clobbers the path variable, breaking fuzzy finding #54

Open
opened 2021年05月16日 14:30:14 +02:00 by SamTebbs33 · 5 comments
SamTebbs33 commented 2021年05月16日 14:30:14 +02:00 (Migrated from github.com)
Copy link

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.

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.
haze commented 2021年05月19日 21:56:28 +02:00 (Migrated from github.com)
Copy link

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

Seems like @LemonBoy added this behavior. I want to ask them what their intention was before thinking about removing it
LemonBoy commented 2021年05月19日 22:09:29 +02:00 (Migrated from github.com)
Copy link

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

I only added some more error checking around that logic, I guess whoever added that wanted `gf` to work on import statements.
matu3ba commented 2021年11月03日 22:24:19 +01:00 (Migrated from github.com)
Copy link

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

@SamTebbs33 Did you try swapping, ie to write in `ftplugin/zig.vim` ```vim let &l:path= &l:path . ',' . json_decode(s:env)['std_dir'] ``` Vim/Neovim should then first look in the current path.
atemmel commented 2022年01月20日 19:02:10 +01:00 (Migrated from github.com)
Copy link

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
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: ```vim let &l:path = g:zig_std_dir . ',' . &l:path ``` To: ```vim let &l:path = &l:path . ',' . g:zig_std_dir ```
matu3ba commented 2024年01月14日 23:46:18 +01:00 (Migrated from github.com)
Copy link

I think this should be closed, since the issue author gave no feedback, if the suggested solution worked or clarify why not.

I think this should be closed, since the issue author gave no feedback, if the suggested solution worked or clarify why not.
Sign in to join this conversation.
No Branch/Tag specified
master
hb/new-keywords
mikdusan-zir
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/zig.vim#54
Reference in a new issue
ziglang/zig.vim
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?