nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit ef35ee891870a6f2cff856c71849f8307e623a5c
parent 7f4a7205dca12736b7fb03334b57ab3342c56b0d
Author: Jason Franklin <j_fra@fastmail.us>
Date:   Tue,  4 Jul 2017 09:45:06 -0400

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.

Diffstat:
Mlib/nerdtree/tree_dir_node.vim | 33+++++++--------------------------
1 file changed, 7 insertions(+), 26 deletions(-)
diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim
@@ -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