diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt index 06a5f08..7ca8f35 100644 --- a/doc/NERD_tree.txt +++ b/doc/NERD_tree.txt @@ -240,8 +240,8 @@ Default key: t Map option: NERDTreeMapOpenInTab Applies to: files and directories. -Opens the selected file in a new tab. If a directory is selected, a netrw is -opened in a new tab. +Opens the selected file in a new tab. If a directory is selected, a fresh +NERD Tree for that directory is opened in a new tab. If a bookmark which points to a directory is selected, open a NERD tree for that directory in a new tab. If the bookmark points to a file, open that file @@ -874,6 +874,10 @@ fridge for later ;) ============================================================================== 7. Changelog *NERDTreeChangelog* +2.x.x + - make the t/T on directory nodes open a fresh NERD tree for the selected + dir in a new tab, rather than a netrw. + 2.12.0 - added a UI for bookmarks. See :help NERDTreeBookmarkTable for details. Thanks to Zhang Shuhan for testing and bug reports. diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index b8198ce..2b82366 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -3214,7 +3214,8 @@ function! s:OpenInNewTab(stayCurrentTab) let treenode = s:GetSelectedNode() if treenode != {} if treenode.path.isDirectory - exec "tabnew +NERDTree\\ " . treenode.path.StrForNERDTreeCmd() + tabnew + call s:InitNerdTree(treenode.path.StrForOS(0)) else exec "tabedit " . treenode.path.StrForEditCmd() endif