Support tab-specific CWDs (#1032)

* Change CWD when switching tabs to the tab's NERDTree root.

* Remove commented-out code.

* List the new possible value for NERDTreeChDirMode in doc.

* Add new option to select between `:cd` and `:tcd`.

* Document the new NERDTreeUseTCD option.

* Update version number in change log.
This commit is contained in:
Phil Runninger
2019-10-16 13:26:20 -04:00
committed by GitHub
parent 4245517689
commit 371feb7e54
5 changed files with 30 additions and 6 deletions

View File

@@ -87,8 +87,13 @@ function! s:Path.changeToDir()
endif
try
execute "cd " . dir
call nerdtree#echo("CWD is now: " . getcwd())
if g:NERDTreeUseTCD && exists(":tcd") == 2
execute "tcd " . dir
call nerdtree#echo("Tab's CWD is now: " . getcwd())
else
execute "cd " . dir
call nerdtree#echo("CWD is now: " . getcwd())
endif
catch
throw "NERDTree.PathChangeError: cannot change CWD to " . dir
endtry