Restore getDirChildren for use in nerdtree-project-plugin. (#929)

This function was added to support a separate plugin:
https://github.com/scrooloose/nerdtree-project-plugin.git. It was
subsequently removed without recognizing its contribution to the
external plugin. This commit restores that function so NERDTree projects
will work.
This commit is contained in:
Phil Runninger 2018-12-11 22:44:55 -05:00 committed by GitHub
parent c1876da09c
commit a4dd4e1dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -254,6 +254,13 @@ function! s:TreeDirNode.getChildIndex(path)
return -1 return -1
endfunction endfunction
" FUNCTION: TreeDirNode.getDirChildren() {{{1
" Return a list of all child nodes from "self.children" that are of type
" TreeDirNode. This function supports http://github.com/scrooloose/nerdtree-project-plugin.git.
function! s:TreeDirNode.getDirChildren()
return filter(copy(self.children), 'v:val.path.isDirectory == 1')
endfunction
" FUNCTION: TreeDirNode._glob(pattern, all) {{{1 " FUNCTION: TreeDirNode._glob(pattern, all) {{{1
" Return a list of strings naming the descendants of the directory in this " Return a list of strings naming the descendants of the directory in this
" TreeDirNode object that match the specified glob pattern. " TreeDirNode object that match the specified glob pattern.