Add a note/warning to "TreeDirNode.activate()"
This warning makes developers aware of the possibility of overwriting the NERDTree text in a new window when activate is used.
This commit is contained in:
parent
e27cd86a9b
commit
4c409a1640
@ -21,12 +21,19 @@ function! s:TreeDirNode.AbsoluteTreeRoot()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: TreeDirNode.activate([options]) {{{1
|
" FUNCTION: TreeDirNode.activate([options]) {{{1
|
||||||
unlet s:TreeDirNode.activate
|
|
||||||
function! s:TreeDirNode.activate(...)
|
function! s:TreeDirNode.activate(...)
|
||||||
let opts = a:0 ? a:1 : {}
|
let l:options = (a:0 > 0) ? a:1 : {}
|
||||||
call self.toggleOpen(opts)
|
|
||||||
call self.getNerdtree().render()
|
call self.toggleOpen(l:options)
|
||||||
call self.putCursorHere(0, 0)
|
|
||||||
|
" Note that we only re-render the NERDTree for this node if we did NOT
|
||||||
|
" create a new node and render it in a new window or tab. In the latter
|
||||||
|
" case, rendering the NERDTree for this node could overwrite the text of
|
||||||
|
" the new NERDTree!
|
||||||
|
if !has_key(l:options, 'where') || empty(l:options['where'])
|
||||||
|
call self.getNerdtree().render()
|
||||||
|
call self.putCursorHere(0, 0)
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: TreeDirNode.addChild(treenode, inOrder) {{{1
|
" FUNCTION: TreeDirNode.addChild(treenode, inOrder) {{{1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user