commit dc349a072ae4abc4747b23d7ab4085c5a1afe589
parent e47e588705bd7d205a3b5a60ac7090c9a2504ba2
Author: Phil Runninger (mac) <prunninger@virtualhold.com>
Date: Tue, 6 Mar 2018 08:41:06 -0500
Use a better check for existence of the NERDTree buffer.
If the user wipes out or deletes (:bw or :bd) the NERDTree buffer, there
is still a tab variable that hangs onto the name of that now-missing
buffer. Checking only that variable is not enough to decide whether to
create a new NERDTree or use the existing one. Fortunately, there
already is a function with a more complete check: ExistsForTab()
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/nerdtree/creator.vim b/lib/nerdtree/creator.vim
@@ -185,7 +185,7 @@ function! s:Creator._createTreeWin()
let splitLocation = g:NERDTreeWinPos ==# "left" ? "topleft " : "botright "
let splitSize = g:NERDTreeWinSize
- if !exists('t:NERDTreeBufName')
+ if !g:NERDTree.ExistsForTab()
let t:NERDTreeBufName = self._nextBufferName()
silent! exec splitLocation . 'vertical ' . splitSize . ' new'
silent! exec "edit " . t:NERDTreeBufName