Fixes #970. Restore silent parameter to _initChildren.

https://github.com/ryanoasis/vim-devicons uses this function directly
with silent set to 1.
This commit is contained in:
Phil Runninger (mac) 2019-03-26 11:57:21 -04:00
parent 839cddc750
commit 7513f256aa

View File

@ -405,15 +405,17 @@ endfunction
" Removes all childen from this node and re-reads them " Removes all childen from this node and re-reads them
" "
" Args: " Args:
" silent: 1 if the function should not echo any "please wait" messages for
" large directories
" "
" Return: the number of child nodes read " Return: the number of child nodes read
function! s:TreeDirNode._initChildren() function! s:TreeDirNode._initChildren(silent)
"remove all the current child nodes "remove all the current child nodes
let self.children = [] let self.children = []
let files = self._glob('*', 1) + self._glob('.*', 0) let files = self._glob('*', 1) + self._glob('.*', 0)
if len(files) > g:NERDTreeNotificationThreshold if !a:silent && len(files) > g:NERDTreeNotificationThreshold
call nerdtree#echo("Please wait, caching a large dir ...") call nerdtree#echo("Please wait, caching a large dir ...")
endif endif
@ -490,7 +492,7 @@ function! s:TreeDirNode.open(...)
let l:numChildrenCached = 0 let l:numChildrenCached = 0
if empty(self.children) if empty(self.children)
let l:numChildrenCached = self._initChildren() let l:numChildrenCached = self._initChildren(0)
endif endif
return l:numChildrenCached return l:numChildrenCached