Fix upward traversal when closing a cascade

This commit is contained in:
Łukasz Adamczak 2016-06-22 13:32:44 +02:00
parent d280b15ba9
commit c99312442b

View File

@ -191,8 +191,8 @@ function! s:closeCurrentDir(node)
call nerdtree#echo("cannot close tree root")
else
while g:NERDTreeCascadeOpenSingleChildDir && !parent.parent.isRoot()
if parent.parent.getVisibleChildCount() == 1
call parent.close()
let childNodes = parent.getVisibleChildren()
if len(childNodes) == 1 && childNodes[0].path.isDirectory
let parent = parent.parent
else
break