summaryrefslogtreecommitdiff
path: root/plugin/fzf.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <janlazo@users.noreply.github.com>2017-07-09 13:06:13 -0400
committerJunegunn Choi <junegunn.c@gmail.com>2017-07-10 02:06:13 +0900
commit940214a1a2cbc64f32539e9a65beafc767f259e2 (patch)
tree07003def4ec6064338a59b47c89a23bfe5c4be0c /plugin/fzf.vim
parent68bd410159500f67e069a5d909f2d3062115cffc (diff)
downloadfzf-940214a1a2cbc64f32539e9a65beafc767f259e2.tar.gz
[neovim] Fix lcd when fzf job exits on Windows (#970)
Related: #960 (relative filepaths)
Diffstat (limited to 'plugin/fzf.vim')
-rw-r--r--plugin/fzf.vim11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index c0675123..24427bed 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -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
+ let lines = s:collect(self.temps)
+ call s:callback(self.dict, lines)
endfunction
let cmd = 'start /wait cmd /c '.command
call jobstart(cmd, fzf)