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:
Phil Runninger
2020-04-13 17:05:27 -04:00
committed by GitHub
parent f767dd34a0
commit 2d7cb043d4
2 changed files with 2 additions and 1 deletions

View File

@@ -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()