mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-23 08:01:52 +08:00
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()
This commit is contained in:
parent
e47e588705
commit
dc349a072a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user