Fix upward traversal when closing a cascade
This commit is contained in:
parent
d280b15ba9
commit
c99312442b
@ -191,8 +191,8 @@ function! s:closeCurrentDir(node)
|
|||||||
call nerdtree#echo("cannot close tree root")
|
call nerdtree#echo("cannot close tree root")
|
||||||
else
|
else
|
||||||
while g:NERDTreeCascadeOpenSingleChildDir && !parent.parent.isRoot()
|
while g:NERDTreeCascadeOpenSingleChildDir && !parent.parent.isRoot()
|
||||||
if parent.parent.getVisibleChildCount() == 1
|
let childNodes = parent.getVisibleChildren()
|
||||||
call parent.close()
|
if len(childNodes) == 1 && childNodes[0].path.isDirectory
|
||||||
let parent = parent.parent
|
let parent = parent.parent
|
||||||
else
|
else
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user