Skip to content
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

Merged
merged 1 commit into from
Jul 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions plugin/fzf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,15 @@ function! s:execute(dict, command, use_height, temps) abort
let command = batchfile
let a:temps.batchfile = batchfile
if has('nvim')
let s:dict = a:dict
let s:temps = a:temps
let fzf = {}
let fzf.dict = a:dict
let fzf.temps = a:temps
function! fzf.on_exit(job_id, exit_status, event) dict
let lines = s:collect(s:temps)
call s:callback(s:dict, lines)
if s:present(self.dict, 'dir')
execute 'lcd' s:escape(self.dict.dir)
endif
Copy link
Owner

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

fzf/plugin/fzf.vim

Lines 677 to 679 in 68bd410

call s:pushd(self.dict)
let lines = s:collect(self.temps)
call s:callback(self.dict, lines)
?

Copy link
Contributor Author

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)

Copy link
Owner

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.

let lines = s:collect(self.temps)
call s:callback(self.dict, lines)
endfunction
let cmd = 'start /wait cmd /c '.command
call jobstart(cmd, fzf)
Expand Down