make TreeFileNode#isRoot() assume a tree exists for current buf, not tab
This commit is contained in:
parent
fb5ee9fbc2
commit
888934a3be
@ -593,9 +593,10 @@ endfunction
|
|||||||
"FUNCTION: TreeFileNode.isRoot() {{{3
|
"FUNCTION: TreeFileNode.isRoot() {{{3
|
||||||
"returns 1 if this node is b:NERDTreeRoot
|
"returns 1 if this node is b:NERDTreeRoot
|
||||||
function! s:TreeFileNode.isRoot()
|
function! s:TreeFileNode.isRoot()
|
||||||
if !s:treeExistsForTab()
|
if !s:treeExistsForBuf()
|
||||||
throw "NERDTree.TreeFileNode.IsRoot exception: No tree exists for the current tab"
|
throw "NERDTree.NoTreeError: No tree exists for the current buffer"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return self.equals(b:NERDTreeRoot)
|
return self.equals(b:NERDTreeRoot)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -1794,6 +1795,11 @@ function! s:initNerdTreeInPlace(dir)
|
|||||||
|
|
||||||
call s:renderView()
|
call s:renderView()
|
||||||
endfunction
|
endfunction
|
||||||
|
" Function: s:treeExistsForBuffer() {{{2
|
||||||
|
" Returns 1 if a nerd tree root exists in the current buffer
|
||||||
|
function! s:treeExistsForBuf()
|
||||||
|
return exists("b:NERDTreeRoot")
|
||||||
|
endfunction
|
||||||
" Function: s:treeExistsForTab() {{{2
|
" Function: s:treeExistsForTab() {{{2
|
||||||
" Returns 1 if a nerd tree root exists in the current tab
|
" Returns 1 if a nerd tree root exists in the current tab
|
||||||
function! s:treeExistsForTab()
|
function! s:treeExistsForTab()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user