nerdtree-project-plugin icon indicating copy to clipboard operation
nerdtree-project-plugin copied to clipboard

A completion can not go with no arguments.

Open DehanLUO opened this issue 3 years ago • 6 comments

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.

DehanLUO avatar Aug 04 '21 13:08 DehanLUO

I am also encountering the same error.

terrencetec avatar Sep 21 '21 16:09 terrencetec

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!

zythina avatar Sep 02 '22 11:09 zythina

Had the same issue with Ubuntu 22.04 on a Macbook using ohmyzsh. I applied this fix locally and it worked. Thanks!

unfirthman avatar Oct 28 '22 17:10 unfirthman

The fix works like a charm, thanks !

jlejeune avatar Mar 14 '23 09:03 jlejeune

Just switched Vundle entry to @DehanLUO 's repo in vimrc and back on track :100: Thanks!

silopolis avatar Dec 26 '23 18:12 silopolis