From 68ec5ba64d23212c5b3ae56599fb758254a2f435 Mon Sep 17 00:00:00 2001 From: Lam Chau Date: Sun, 18 Jul 2021 21:33:49 -0700 Subject: [PATCH] correct nargs errors for vim 8.2.3150+ https://github.com/vim/vim/pull/8544 introduced a change that displays an error when `nargs` is not defined and/or defined incorrectly. As a user, this will display an error message each time upon starting up. The error shows up as ``` Error detected while processing ~/.vim/plugged/vim-ripgrep/plugin/vim-ripgrep.vim: line 149: E1208: -complete used without -nargs Press ENTER or type command to continue ``` This fix to add `-nargs=?` to each of the `command`s. Fixes #57 --- plugin/vim-ripgrep.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/vim-ripgrep.vim b/plugin/vim-ripgrep.vim index 9bc029d..1367ded 100644 --- a/plugin/vim-ripgrep.vim +++ b/plugin/vim-ripgrep.vim @@ -145,5 +145,5 @@ fun! s:RgShowRoot() endif endfun -command! -nargs=* -complete=file Rg :call s:Rg() -command! -complete=file RgRoot :call s:RgShowRoot() +command! -nargs=? -complete=file Rg :call s:Rg() +command! -nargs=? -complete=file RgRoot :call s:RgShowRoot()