nerdtree-project-plugin
nerdtree-project-plugin copied to clipboard
A completion can not go with no arguments.
Reproduce the bug
~/.vim/vimrc
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree'
Plug 'scrooloose/nerdtree-project-plugin'
call plug#end()
Open vim.
Describe the bug
My vim (8.2.3200) gives the following warning with the two plugins installed.
Error detected while processing /home/admin/.vim/plugged/nerdtree/plugin/NERD_tree.vim[229]..function nerdtree#postSourceActions[5]..script /home/admin/.vim/plugged/nerdtree-project-plugin/nerdtree_plugin/project.vim:
line 45: E1208: -complete used without -nargsPress
Looking at the repo for project.vim, the existing code causes the warning.
command! -nargs=0 -complete=customlist,NERDTreeCompleteProjectNames NERDTreeProjectLoadFromCWD call g:NERDTreeProject.LoadFromCWD()
A completion should go with at least an argument, while -nargs=0 means no arguments are allowed. Changing to –nargs=?, specifying 0 or 1 arguments are allowed, can solve the problem.
I am also encountering the same error.
Same error on both Windows 11 with Powershell and Arch Linux on bash and zshrc ( although it may not be relevant )
LE: This branch's fix worked for me, thank you!
Had the same issue with Ubuntu 22.04 on a Macbook using ohmyzsh. I applied this fix locally and it worked. Thanks!
The fix works like a charm, thanks !
Just switched Vundle entry to @DehanLUO 's repo in vimrc and back on track :100: Thanks!