mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-23 12:07:26 +08:00
Make the "o" mapping consistent with "x"
The "o" mapping, which toggles directory nodes open/closed, allowed the user to close the tree root. This was not consistent with the "x" mapping which stops the user from doing this. This applies to a double-click on the root node as well. It should be noted that, if the root node is somehow closed, "o" and double click can still re-open the tree, even with this change. In other words, I was careful.
This commit is contained in:
parent
e0e36c5385
commit
ac94cd28c2
|
@ -90,10 +90,15 @@ function! s:activateAll()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: s:activateDirNode() {{{1
|
" FUNCTION: s:activateDirNode(directoryNode) {{{1
|
||||||
"handle the user activating a tree node
|
function! s:activateDirNode(directoryNode)
|
||||||
function! s:activateDirNode(node)
|
|
||||||
call a:node.activate()
|
if a:directoryNode.isRoot() && a:directoryNode.isOpen
|
||||||
|
call nerdtree#echo('cannot close tree root')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
call a:directoryNode.activate()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: s:activateFileNode() {{{1
|
"FUNCTION: s:activateFileNode() {{{1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user