Skip to content

Commit

Permalink
Update vim-plug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Alman authored and Ben Alman committed Jul 10, 2017
1 parent 78e6ee1 commit 9f55acd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
10 changes: 7 additions & 3 deletions link/.vim/autoload/plug.vim
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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'])
Expand Down Expand Up @@ -579,7 +583,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)
Expand Down
18 changes: 11 additions & 7 deletions link/.vim/autoload/plug.vim.old
Expand Up @@ -97,7 +97,7 @@ let s:plug_tab = get(s:, 'plug_tab', -1)
let s:plug_buf = get(s:, 'plug_buf', -1)
let s:mac_gui = has('gui_macvim') && has('gui_running')
let s:is_win = has('win32') || has('win64')
let s:nvim = has('nvim') && exists('*jobwait') && !s:is_win
let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win)
let s:vim8 = has('patch-8.0.0039') && exists('*job_start')
let s:me = resolve(expand('<sfile>:p'))
let s:base_spec = { 'branch': 'master', 'frozen': 0 }
Expand Down Expand Up @@ -447,11 +447,15 @@ function! plug#load(...)
let s = len(unknowns) > 1 ? 's' : ''
return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', ')))
end
for name in a:000
call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
endfor
call s:dobufread(a:000)
return 1
let unloaded = filter(copy(a:000), '!get(s:loaded, v:val, 0)')
if !empty(unloaded)
for name in unloaded
call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
endfor
call s:dobufread(unloaded)
return 1
end
return 0
endfunction

function! s:remove_triggers(name)
Expand Down Expand Up @@ -2022,7 +2026,7 @@ function! s:git_validate(spec, check_branch)
" Check tag
if has_key(a:spec, 'tag')
let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir)
if a:spec.tag !=# tag
if a:spec.tag !=# tag && a:spec.tag !~ '\*'
let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.',
\ (empty(tag) ? 'N/A' : tag), a:spec.tag)
endif
Expand Down

0 comments on commit 9f55acd

Please sign in to comment.