From 779e13374a29b736d25f255c281383862637f5ac Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Tue, 27 Jun 2017 11:10:52 -0400 Subject: [PATCH] Edit the filter in the TreeDirNode glob method A better style for executing the removal of each filtered name was chosen. This is a minor change, but I viewed it as necessary. --- lib/nerdtree/tree_dir_node.vim | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim index feee772..a693c6d 100644 --- a/lib/nerdtree/tree_dir_node.vim +++ b/lib/nerdtree/tree_dir_node.vim @@ -256,7 +256,6 @@ function! s:TreeDirNode._glob(pattern, all) " If "a:all" is false, filter "." and ".." from the output. if !a:all - let l:toRemove = [] for l:file in l:globList @@ -275,10 +274,9 @@ function! s:TreeDirNode._glob(pattern, all) endif endfor - if !empty(l:toRemove) - call remove(l:globList, index(l:globList, l:toRemove[0])) - call remove(l:globList, index(l:globList, l:toRemove[1])) - endif + for l:file in l:toRemove + call remove(l:globList, index(l:globList, l:file)) + endfor endif return l:globList