Skip to content

Commit 5c61a9e

Browse files
committed
Warn about invalid files not loaded on-refresh
1 parent 2c6d552 commit 5c61a9e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/nerdtree/tree_dir_node.vim

+4-2
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ function! s:TreeDirNode.refresh()
566566
let files = self._glob('*', 1) + self._glob('.*', 0)
567567
let newChildNodes = []
568568
let invalidFilesFound = 0
569+
let invalidFiles = []
569570
for i in files
570571
try
571572
"create a new path and see if it exists in this nodes children
@@ -582,7 +583,8 @@ function! s:TreeDirNode.refresh()
582583
call add(newChildNodes, newNode)
583584
endif
584585
catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/
585-
let invalidFilesFound = 1
586+
let invalidFilesFound += 1
587+
let invalidFiles += [i]
586588
endtry
587589
endfor
588590

@@ -591,7 +593,7 @@ function! s:TreeDirNode.refresh()
591593
call self.sortChildren()
592594

593595
if invalidFilesFound
594-
call nerdtree#echoWarning('some files could not be loaded into the NERD tree')
596+
call nerdtree#echoWarning(invalidFilesFound . ' Invalid file(s): ' . join(invalidFiles, ', '))
595597
endif
596598
endif
597599
endfunction

0 commit comments

Comments
 (0)