summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-01-11 18:17:13 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-01-11 18:17:13 +0900
commitb18db4733c635705b3aa052efe91472432727c58 (patch)
treeffe3da3130934a315f47dfcec3a2311e299eedcf
parent6e08fe337cf90cd6eb4734000fe6da1d37184014 (diff)
[vim] Do not restore working directory on unexpected cwd
We should not restore the previous working directory if the current directory has changed somehow. This can happen when &autochdir is set.
-rw-r--r--plugin/fzf.vim2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 89f1b21e..8dc5b8a1 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -201,7 +201,7 @@ function! s:pushd(dict)
endfunction
function! s:popd(dict)
- if has_key(a:dict, 'prev_dir')
+ if has_key(a:dict, 'prev_dir') && getcwd() ==# a:dict.dir
execute 'chdir '.s:escape(remove(a:dict, 'prev_dir'))
endif
endfunction