Update vim plug

This commit is contained in:
Tony Grosinger 2017-09-14 07:04:56 -07:00 committed by Tony Grosinger
parent 077fefc32b
commit b2ba936a85
2 changed files with 7 additions and 3 deletions

View File

@ -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'])

View File

@ -579,7 +579,7 @@ function! s:infer_properties(name, repo)
let uri = repo
else
if repo !~ '/'
let repo = 'vim-scripts/'. repo
throw printf('Invalid argument: %s (implicit `vim-scripts'' expansion is deprecated)', repo)
endif
let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git')
let uri = printf(fmt, repo)