mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-23 03:18:01 +08:00
Improve the style in a "TreeFileNode" method
No functional changes here.
This commit is contained in:
parent
d745e11b42
commit
c6a68d4b96
|
@ -196,14 +196,18 @@ function! s:TreeFileNode.GetRootForTab()
|
|||
endfunction
|
||||
|
||||
" FUNCTION: TreeFileNode.GetSelected() {{{1
|
||||
" gets the treenode that the cursor is currently over
|
||||
" If the cursor is currently positioned on a tree node, return the node.
|
||||
" Otherwise, return the empty dictionary.
|
||||
function! s:TreeFileNode.GetSelected()
|
||||
|
||||
try
|
||||
let path = b:NERDTree.ui.getPath(line("."))
|
||||
if path ==# {}
|
||||
let l:path = b:NERDTree.ui.getPath(line('.'))
|
||||
|
||||
if empty(l:path)
|
||||
return {}
|
||||
endif
|
||||
return b:NERDTree.root.findNode(path)
|
||||
|
||||
return b:NERDTree.root.findNode(l:path)
|
||||
catch /^NERDTree/
|
||||
return {}
|
||||
endtry
|
||||
|
|
Loading…
Reference in New Issue
Block a user