mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Prevent unneeded tree creation in :NERDTreeToggle[VCS] <path> (#1101)
* Don't recreate the NERDTree if its root is the same as being requested. * Use single quotes per Vint's style recommendation. * Update version number in changelog. * Use a simpler method of getting the NERDTree root path. * Remove variable. Just compare agains the function call's result.
This commit is contained in:
@@ -366,7 +366,7 @@ function! s:Creator.toggleTabTree(dir)
|
||||
if g:NERDTree.ExistsForTab()
|
||||
if !g:NERDTree.IsOpen()
|
||||
call self._createTreeWin()
|
||||
if !empty(a:dir)
|
||||
if !empty(a:dir) && a:dir !=# b:NERDTree.root.path.str()
|
||||
call self.createTabTree(a:dir)
|
||||
elseif !&hidden
|
||||
call b:NERDTree.render()
|
||||
|
||||
Reference in New Issue
Block a user