nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 7f4a7205dca12736b7fb03334b57ab3342c56b0d
parent ebc206e58d959dd244ddbb82e5e784d51b6c2c6b
Author: Jason Franklin <j_fra@fastmail.us>
Date:   Sun,  2 Jul 2017 14:57:33 -0400

Replace an equality test with an instance method

A proper instance method was substituted for the more brittle
equality test in the "TreeDirNode.open()" method.

Note that the order of the tests was reversed to account for the
fact that the "isRoot()" method can only be called after the first
test has passed.

Diffstat:
Mlib/nerdtree/tree_dir_node.vim | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim
@@ -431,7 +431,7 @@ function! s:TreeDirNode.open(...)
 
     " Open any ancestors of this node that render within the same cascade.
     let l:parent = self.parent
-    while l:parent != b:NERDTree.root && !empty(l:parent)
+    while !empty(l:parent) && !l:parent.isRoot()
         if index(l:parent.getCascade(), self) >= 0
             let l:parent.isOpen = 1
             let l:parent = l:parent.parent