Improve the style in a "TreeFileNode" method

No functional changes here.
This commit is contained in:
Jason Franklin 2018-01-06 09:02:10 -05:00
parent d745e11b42
commit c6a68d4b96

View File

@ -196,14 +196,18 @@ function! s:TreeFileNode.GetRootForTab()
endfunction endfunction
" FUNCTION: TreeFileNode.GetSelected() {{{1 " 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() function! s:TreeFileNode.GetSelected()
try try
let path = b:NERDTree.ui.getPath(line(".")) let l:path = b:NERDTree.ui.getPath(line('.'))
if path ==# {}
if empty(l:path)
return {} return {}
endif endif
return b:NERDTree.root.findNode(path)
return b:NERDTree.root.findNode(l:path)
catch /^NERDTree/ catch /^NERDTree/
return {} return {}
endtry endtry