Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On load show which files were not loaded #1274

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/nerdtree/tree_dir_node.vim
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,15 @@ function! s:TreeDirNode._initChildren(silent)
endif

let invalidFilesFound = 0
let invalidFiles = []
for i in files
try
let path = g:NERDTreePath.New(i)
call self.createChild(path, 0)
call g:NERDTreePathNotifier.NotifyListeners('init', path, self.getNerdtree(), {})
catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/
let invalidFilesFound += 1
let invalidFiles += [i]
endtry
endfor

Expand All @@ -438,6 +440,7 @@ function! s:TreeDirNode._initChildren(silent)

if invalidFilesFound
call nerdtree#echoWarning(invalidFilesFound . ' file(s) could not be loaded into the NERD tree')
call nerdtree#echoWarning('Invalid files: ' . join(invalidFiles, ', '))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combine these two nerdtree#echoWarning calls into one. Something like: 3 Invalid Files: foo.txt, bar.txt, snafu.txt

endif
return self.getChildCount()
endfunction
Expand Down