aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-08-11 19:13:38 +0200
committerDuncaen <mail@duncano.de>2017-08-11 19:13:38 +0200
commit890b243432ec504012eda8c54c13663e56d5fdf6 (patch)
tree5b4f123b29677ef64c70ba98f0dd0a6668928957
parent8a4b818a15a5257d093c9564d2c3c08451428216 (diff)
downloaddotfiles-890b243432ec504012eda8c54c13663e56d5fdf6.tar.gz
vim: update plug
-rw-r--r--vim/autoload/plug.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/vim/autoload/plug.vim b/vim/autoload/plug.vim
index ac299a2..e0dc78f 100644
--- a/vim/autoload/plug.vim
+++ b/vim/autoload/plug.vim
@@ -121,6 +121,9 @@ function! plug#begin(...)
else
return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.')
endif
+ if fnamemodify(home, ':t') ==# 'plugin' && fnamemodify(home, ':h') ==# s:first_rtp
+ return s:err('Invalid plug home. '.home.' is a standard Vim runtime path and is not allowed.')
+ endif
let g:plug_home = home
let g:plugs = {}
@@ -442,12 +445,13 @@ function! plug#load(...)
if !exists('g:plugs')
return s:err('plug#begin was not called')
endif
- let unknowns = filter(copy(a:000), '!has_key(g:plugs, v:val)')
+ let names = a:0 == 1 && type(a:1) == s:TYPE.list ? a:1 : a:000
+ let unknowns = filter(copy(names), '!has_key(g:plugs, v:val)')
if !empty(unknowns)
let s = len(unknowns) > 1 ? 's' : ''
return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', ')))
end
- let unloaded = filter(copy(a:000), '!get(s:loaded, v:val, 0)')
+ let unloaded = filter(copy(names), '!get(s:loaded, v:val, 0)')
if !empty(unloaded)
for name in unloaded
call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])