update plug.vim

This commit is contained in:
Felix Van der Jeugt 2017-06-23 13:24:21 +02:00
parent 69e44c2ddd
commit f37e5e5ea6
No known key found for this signature in database
GPG Key ID: 58B209295023754D
1 changed files with 3 additions and 2 deletions

View File

@ -442,12 +442,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'])