mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user