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") 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