NERDTreeCWD: reset CWD if changed by NERDTreeFocus
When the user has `'autochdir'` turned on, opening a new NERDTree will cause the current working directory to change. To prevent this happening, remember the CWD and reset it if NERDTreeFocus caused it to change.
This commit is contained in:
parent
e653a68270
commit
18071f5999
@ -202,7 +202,11 @@ function! NERDTreeFocus()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! NERDTreeCWD()
|
function! NERDTreeCWD()
|
||||||
|
let l:cwd = getcwd()
|
||||||
call NERDTreeFocus()
|
call NERDTreeFocus()
|
||||||
|
if l:cwd != getcwd()
|
||||||
|
exec 'cd '.l:cwd
|
||||||
|
endif
|
||||||
call nerdtree#ui_glue#chRootCwd()
|
call nerdtree#ui_glue#chRootCwd()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user