From 03f7e1ee50c857ba281fa28cbc4d242d18f2bc97 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Thu, 4 Jun 2020 18:03:34 +0530 Subject: [PATCH] nvim: plug: Upgrade vim-plug Signed-off-by: Sanchayan Maity --- nvim/.local/share/nvim/site/autoload/plug.vim | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/nvim/.local/share/nvim/site/autoload/plug.vim b/nvim/.local/share/nvim/site/autoload/plug.vim index 25be27f..8332537 100644 --- a/nvim/.local/share/nvim/site/autoload/plug.vim +++ b/nvim/.local/share/nvim/site/autoload/plug.vim @@ -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