-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[neovim] Fix lcd when fzf job exits on Windows #970
Conversation
Thanks, can you post a scenario that reproduces the problem for future reference? |
From #960 (with error redirection to powershell's C:\Windows\System32>set FZF_DEFAULT_COMMAND=powershell.exe -NoLogo -NoProfile -Noninteractive -Command "Get-ChildItem -File -Recurse -Name 2> $null"
C:\Windows\System32>fzf
:: outputs a relative path Compare with Vim/Neovim using the same minimal config. Vim changes the working directory but Neovim does not (without running lcd in the exit callback). " assume fzf is installed in ~/.fzf
set rtp+=~/.fzf
runtime! plugin/fzf.vim
set noshellslash
FZF C:\Program\ Files\ (x86)\ |
Related: junegunn#960 (relative filepaths)
call s:callback(s:dict, lines) | ||
if s:present(self.dict, 'dir') | ||
execute 'lcd' s:escape(self.dict.dir) | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if we can use call s:pushd(self.dict)
instead as in
Lines 677 to 679 in 68bd410
call s:pushd(self.dict) | |
let lines = s:collect(self.temps) | |
call s:callback(self.dict, lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't work. self.dict.prev_dir
is set by the earlier s:pushd(a:dict)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for the confirmation.
Thanks! |
#896 did not consider relative filepaths in the exit handler because
dir /s/b
outputs absolute paths. I changed dict and temp to be part of the fzf job config to minimize issues with the exit handler when running:FZF
consecutively in Neovim.