NERDTree <start-directory> always sets NERDTree root.

This commit is contained in:
Phil Runninger
2020-01-28 03:55:58 -05:00
parent f7b09634ba
commit e48b5728f9
3 changed files with 13 additions and 7 deletions

View File

@@ -355,17 +355,20 @@ function! s:Creator.ToggleTabTree(dir)
endfunction
" FUNCTION: s:Creator.toggleTabTree(dir) {{{1
" Toggles the NERD tree. I.e the NERD tree is open, it is closed, if it is
" closed it is restored or initialized (if it doesnt exist)
" Toggles the NERD tree. I.e if the NERD tree is open, it is closed. If it is
" closed, it is restored or initialized. If dir is not empty, it will be set
" as the new root.
"
" Args:
" dir: the full path for the root node (is only used if the NERD tree is being
" initialized.
" dir: the full path for the root node (is used if the NERD tree is being
" initialized, or to change the root to a new dir.)
function! s:Creator.toggleTabTree(dir)
if g:NERDTree.ExistsForTab()
if !g:NERDTree.IsOpen()
call self._createTreeWin()
if !&hidden
if !empty(a:dir)
call self.createTabTree(a:dir)
elseif !&hidden
call b:NERDTree.render()
endif
call b:NERDTree.ui.restoreScreenState()