From 7f4a7205dca12736b7fb03334b57ab3342c56b0d Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Sun, 2 Jul 2017 14:57:33 -0400 Subject: [PATCH] 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. --- lib/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 index ac89c82..5c9fe72 100644 --- 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