[vim] Use lcd instead of chdir

https://github.com/junegunn/fzf.vim/issues/147
This commit is contained in:
Junegunn Choi 2016-06-02 22:24:47 +09:00
parent 923feb69ab
commit 412c211655
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -193,7 +193,7 @@ function! s:pushd(dict)
return 1 return 1
endif endif
let a:dict.prev_dir = cwd let a:dict.prev_dir = cwd
execute 'chdir' s:escape(a:dict.dir) execute 'lcd' s:escape(a:dict.dir)
let a:dict.dir = getcwd() let a:dict.dir = getcwd()
return 1 return 1
endif endif
@ -214,7 +214,7 @@ function! s:popd(dict, lines)
" directory is not expected and should be undone. " directory is not expected and should be undone.
if has_key(a:dict, 'prev_dir') && if has_key(a:dict, 'prev_dir') &&
\ (!&autochdir || (empty(a:lines) || len(a:lines) == 1 && empty(a:lines[0]))) \ (!&autochdir || (empty(a:lines) || len(a:lines) == 1 && empty(a:lines[0])))
execute 'chdir' s:escape(remove(a:dict, 'prev_dir')) execute 'lcd' s:escape(remove(a:dict, 'prev_dir'))
endif endif
endfunction endfunction