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.
This commit is contained in:
Jason Franklin 2017-07-02 14:57:33 -04:00
parent ebc206e58d
commit 7f4a7205dc

View File

@ -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