nvim: plug: Upgrade vim-plug
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
parent
eb2415300e
commit
03f7e1ee50
1 changed files with 23 additions and 1 deletions
|
@ -632,17 +632,39 @@ function! plug#(repo, ...)
|
|||
let g:plugs[name] = spec
|
||||
let s:loaded[name] = get(s:loaded, name, 0)
|
||||
catch
|
||||
return s:err(v:exception)
|
||||
return s:err(repo . ' ' . v:exception)
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! s:parse_options(arg)
|
||||
let opts = copy(s:base_spec)
|
||||
let type = type(a:arg)
|
||||
let opt_errfmt = 'Invalid argument for "%s" option of :Plug (expected: %s)'
|
||||
if type == s:TYPE.string
|
||||
if empty(a:arg)
|
||||
throw printf(opt_errfmt, 'tag', 'string')
|
||||
endif
|
||||
let opts.tag = a:arg
|
||||
elseif type == s:TYPE.dict
|
||||
call extend(opts, a:arg)
|
||||
for opt in ['branch', 'tag', 'commit', 'rtp', 'dir', 'as']
|
||||
if has_key(opts, opt)
|
||||
\ && (type(opts[opt]) != s:TYPE.string || empty(opts[opt]))
|
||||
throw printf(opt_errfmt, opt, 'string')
|
||||
endif
|
||||
endfor
|
||||
for opt in ['on', 'for']
|
||||
if has_key(opts, opt)
|
||||
\ && type(opts[opt]) != s:TYPE.list
|
||||
\ && (type(opts[opt]) != s:TYPE.string || empty(opts[opt]))
|
||||
throw printf(opt_errfmt, opt, 'string or list')
|
||||
endif
|
||||
endfor
|
||||
if has_key(opts, 'do')
|
||||
\ && type(opts.do) != s:TYPE.funcref
|
||||
\ && (type(opts.do) != s:TYPE.string || empty(opts.do))
|
||||
throw printf(opt_errfmt, 'do', 'string or funcref')
|
||||
endif
|
||||
if has_key(opts, 'dir')
|
||||
let opts.dir = s:dirpath(s:plug_expand(opts.dir))
|
||||
endif
|
||||
|
|
Loading…
Reference in a new issue