Skip to content
Myr

[vim] Fix issues with other plugins changing working directory

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Close #1005

authored by Junegunn Choi · committed by Junegunn Choi · parent 999d374 · Browse files · 1 file+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−5 removed

  • other:+5 added−5 removed

1 file+5 added−5 removed

modified:plugin/fzf.vim+5 added-5 removed
464 unmodified lines
465 autocmd WinEnter * call s:dopopd()466augroup END467468function! s:dopopd()469 if !exists('w:fzf_prev_dir') || exists('*haslocaldir') && !haslocaldir()469 if !exists('w:fzf_dir') || s:fzf_getcwd() != w:fzf_dir[1]470 return471 endif472 execute 'lcd' s:escape(w:fzf_prev_dir)473 unlet w:fzf_prev_dir472 execute 'lcd' s:escape(w:fzf_dir[0])473 unlet w:fzf_dir474endfunction475476function! s:xterm_launcher()477 let fmt = 'xterm -T "[fzf]" -bg "\%s" -fg "\%s" -geometry %dx%d+%d+%d -e bash -ic %%s'
240 unmodified lines
718 " directory is not expected and should be undone.719 let popd = has_key(a:dict, 'prev_dir') &&720 \ (!&autochdir || (empty(a:lines) || len(a:lines) == 1 && empty(a:lines[0])))721 if popd722 let w:fzf_prev_dir = a:dict.prev_dir722 let w:fzf_dir = [a:dict.prev_dir, a:dict.dir]723 endif724725 try726 if has_key(a:dict, 'sink')
15 unmodified lines
742 endtry743744 " We may have opened a new window or tab745 if popd746 let w:fzf_prev_dir = a:dict.prev_dir746 let w:fzf_dir = [a:dict.prev_dir, a:dict.dir]747 call s:dopopd()748 endif749endfunction750
32 unmodified lines