Remove the helper function for "openRecursively()"

The support function for this method was unnecessary, so I took the
time to remove it. Since "TreeDirNode.openRecursively()" now calls
the "open()" method, it can take advantage of the improvements made
to that function in recent commits. Specifically, this method will
reflect the bugfix provided in pull request #720.
This commit is contained in:
Jason Franklin 2017-07-04 09:45:06 -04:00
parent 7f4a7205dc
commit ef35ee8918

View File

@ -492,35 +492,16 @@ function! s:TreeDirNode._openInNewTab()
endfunction
" FUNCTION: TreeDirNode.openRecursively() {{{1
" Opens this treenode and all of its children whose paths arent 'ignored'
" because of the file filters.
"
" This method is actually a wrapper for the OpenRecursively2 method which does
" the work.
" Open this directory node and any descendant directory nodes whose pathnames
" are not ignored.
function! s:TreeDirNode.openRecursively()
call self._openRecursively2(1)
endfunction
silent call self.open()
" FUNCTION: TreeDirNode._openRecursively2() {{{1
" Opens this all children of this treenode recursively if either:
" *they arent filtered by file filters
" *a:forceOpen is 1
"
" Args:
" forceOpen: 1 if this node should be opened regardless of file filters
function! s:TreeDirNode._openRecursively2(forceOpen)
if self.path.ignore(self.getNerdtree()) ==# 0 || a:forceOpen
let self.isOpen = 1
if self.children ==# []
call self._initChildren(1)
for l:child in self.children
if l:child.path.isDirectory && !l:child.path.ignore(l:child.getNerdtree())
call l:child.openRecursively()
endif
for i in self.children
if i.path.isDirectory ==# 1
call i._openRecursively2(0)
endif
endfor
endif
endfor
endfunction
" FUNCTION: TreeDirNode.refresh() {{{1