mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-09 00:22:02 -07:00
[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.
This commit is contained in:
@@ -201,7 +201,7 @@ function! s:pushd(dict)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:popd(dict)
|
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'))
|
execute 'chdir '.s:escape(remove(a:dict, 'prev_dir'))
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
Reference in New Issue
Block a user