nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 820955e77308d2c3d324bde152c0dca9d69c735f
parent 5381197747c8ead163071542c77fe76379aaf84e
Author: Phil Runninger <PhilRunninger@users.noreply.github.com>
Date:   Thu, 18 Oct 2018 11:35:00 -0400

Catch all errors, not just NERDTree errors. (#894)

When middle-clicking, the s:TreeFileNode.GetSelected() function is
called along the way. If this is done outside of the NERDTree window,
there is not "b:NERDTree" variable, and the "E121: Undefined variable"
exception is thrown. This function was trying to catch only the NERDTree
specific errors; thus, it let the Undefined variable exception slip by.
This commit causes the function to catch all errors.
Diffstat:
Mlib/nerdtree/tree_file_node.vim | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/nerdtree/tree_file_node.vim b/lib/nerdtree/tree_file_node.vim
@@ -180,7 +180,7 @@ function! s:TreeFileNode.GetSelected()
         endif
 
         return b:NERDTree.root.findNode(l:path)
-    catch /^NERDTree/
+    catch
         return {}
     endtry
 endfunction