Rename script-local function to generate better error message

This commit renames s:add which is called on Plug command to s:Plug.

E116: Invalid arguments for function <SNR>2_Plug

Related: #407
This commit is contained in:
Junegunn Choi 2016-02-13 12:44:52 +09:00
parent 3e712f3936
commit 8d4c341a0a

View File

@ -128,7 +128,7 @@ function! plug#begin(...)
endfunction endfunction
function! s:define_commands() function! s:define_commands()
command! -nargs=+ -bar Plug call s:add(<args>) command! -nargs=+ -bar Plug call s:Plug(<args>)
if !executable('git') if !executable('git')
return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.')
endif endif
@ -458,7 +458,7 @@ function! s:lod_map(map, names, prefix)
call feedkeys(a:prefix . substitute(a:map, '^<Plug>', "\<Plug>", '') . extra) call feedkeys(a:prefix . substitute(a:map, '^<Plug>', "\<Plug>", '') . extra)
endfunction endfunction
function! s:add(repo, ...) function! s:Plug(repo, ...)
if a:0 > 1 if a:0 > 1
return s:err('Invalid number of arguments (1..2)') return s:err('Invalid number of arguments (1..2)')
endif endif