From 0b4542fcdf52b51e026db230a0ec6c06e5eff00d Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 29 Jul 2015 17:55:58 +0900 Subject: [PATCH] [vim] Temporarily disable &autochdir when opening files (#306) --- plugin/fzf.vim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugin/fzf.vim b/plugin/fzf.vim index c9eb6d1..d81784d 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -368,9 +368,15 @@ function! s:cmd_callback(lines) abort endif let key = remove(a:lines, 0) let cmd = get(s:action, key, 'e') - for item in a:lines - execute cmd s:escape(item) - endfor + try + let autochdir = &autochdir + set noautochdir + for item in a:lines + execute cmd s:escape(item) + endfor + finally + let &autochdir = autochdir + endtry endfunction function! s:cmd(bang, ...) abort