Skip to content

Commit 2c6d552

Browse files
Rafael Monicorzvxa
Rafael Monico
andcommitted
Warn about invalid files not loaded on-load
Co-authored-by: rzvxa <[email protected]>
1 parent 7f81e0c commit 2c6d552

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/nerdtree/tree_dir_node.vim

+3-1
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,15 @@ function! s:TreeDirNode._initChildren(silent)
421421
endif
422422

423423
let invalidFilesFound = 0
424+
let invalidFiles = []
424425
for i in files
425426
try
426427
let path = g:NERDTreePath.New(i)
427428
call self.createChild(path, 0)
428429
call g:NERDTreePathNotifier.NotifyListeners('init', path, self.getNerdtree(), {})
429430
catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/
430431
let invalidFilesFound += 1
432+
let invalidFiles += [i]
431433
endtry
432434
endfor
433435

@@ -437,7 +439,7 @@ function! s:TreeDirNode._initChildren(silent)
437439
call nerdtree#echo('')
438440

439441
if invalidFilesFound
440-
call nerdtree#echoWarning(invalidFilesFound . ' file(s) could not be loaded into the NERD tree')
442+
call nerdtree#echoWarning(invalidFilesFound . ' Invalid file(s): ' . join(invalidFiles, ', '))
441443
endif
442444
return self.getChildCount()
443445
endfunction

0 commit comments

Comments
 (0)