Add correspoding close action to cascade open single child dir
This commit is contained in:
parent
60683f1cce
commit
6ef67a2d8e
@ -1068,9 +1068,17 @@ function! s:closeCurrentDir(node)
|
|||||||
if parent ==# {} || parent.isRoot()
|
if parent ==# {} || parent.isRoot()
|
||||||
call nerdtree#echo("cannot close tree root")
|
call nerdtree#echo("cannot close tree root")
|
||||||
else
|
else
|
||||||
call a:node.parent.close()
|
while g:NERDTreeCascadeOpenSingleChildDir && !parent.parent.isRoot()
|
||||||
|
if parent.parent.getVisibleChildCount() == 1
|
||||||
|
call parent.close()
|
||||||
|
let parent = parent.parent
|
||||||
|
else
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
call parent.close()
|
||||||
call nerdtree#renderView()
|
call nerdtree#renderView()
|
||||||
call a:node.parent.putCursorHere(0, 0)
|
call parent.putCursorHere(0, 0)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -993,8 +993,9 @@ Default: 1.
|
|||||||
|
|
||||||
When opening dir nodes, this option tells NERDTree to recursively open dirs
|
When opening dir nodes, this option tells NERDTree to recursively open dirs
|
||||||
that have only one child which is also a dir. NERDTree will stop when it finds
|
that have only one child which is also a dir. NERDTree will stop when it finds
|
||||||
a dir that contains anything but another single dir. This option may be useful
|
a dir that contains anything but another single dir. Set this option on also
|
||||||
for Java projects. Use one of the follow lines to set this option: >
|
cause NERDTree close parent dir intelligent. This option may be useful for Java
|
||||||
|
projects. Use one of the follow lines to set this option: >
|
||||||
let NERDTreeCascadeOpenSingleChildDir=0
|
let NERDTreeCascadeOpenSingleChildDir=0
|
||||||
let NERDTreeCascadeOpenSingleChildDir=1
|
let NERDTreeCascadeOpenSingleChildDir=1
|
||||||
<
|
<
|
||||||
|
Loading…
x
Reference in New Issue
Block a user