Skip to content

Commit

Permalink
Prevent unneeded tree creation in :NERDTreeToggle[VCS] <path> (#1101)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
PhilRunninger authored Apr 13, 2020
1 parent f767dd3 commit 2d7cb04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
-->
#### 6.7
- **.5**: Prevent unneeded tree creation in :NERDTreeToggle[VCS] <path> (PhilRunninger) [#1101](https://github.com/preservim/nerdtree/pull/1101)
- **.4**: Add missing calls to the `shellescape()` function (lifecrisis) [#1099](https://github.com/preservim/nerdtree/pull/1099)
- **.3**: Fix vsplit to not open empty buffers when opening previously closed file (AwkwardKore) [#1098](https://github.com/preservim/nerdtree/pull/1098)
- **.2**: Fix infinity loop (on winvim) in FindParentVCSRoot (Eugenij-W) [#1095](https://github.com/preservim/nerdtree/pull/1095)
Expand Down
2 changes: 1 addition & 1 deletion lib/nerdtree/creator.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 2d7cb04

Please sign in to comment.