mirror of
https://github.com/gryf/.vim.git
synced 2025-12-18 03:50:30 +01:00
vim-plug update
This commit is contained in:
@@ -97,7 +97,7 @@ let s:plug_tab = get(s:, 'plug_tab', -1)
|
|||||||
let s:plug_buf = get(s:, 'plug_buf', -1)
|
let s:plug_buf = get(s:, 'plug_buf', -1)
|
||||||
let s:mac_gui = has('gui_macvim') && has('gui_running')
|
let s:mac_gui = has('gui_macvim') && has('gui_running')
|
||||||
let s:is_win = has('win32') || has('win64')
|
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:vim8 = has('patch-8.0.0039') && exists('*job_start')
|
||||||
let s:me = resolve(expand('<sfile>:p'))
|
let s:me = resolve(expand('<sfile>:p'))
|
||||||
let s:base_spec = { 'branch': 'master', 'frozen': 0 }
|
let s:base_spec = { 'branch': 'master', 'frozen': 0 }
|
||||||
@@ -447,11 +447,15 @@ function! plug#load(...)
|
|||||||
let s = len(unknowns) > 1 ? 's' : ''
|
let s = len(unknowns) > 1 ? 's' : ''
|
||||||
return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', ')))
|
return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', ')))
|
||||||
end
|
end
|
||||||
for name in a:000
|
let unloaded = filter(copy(a:000), '!get(s:loaded, v:val, 0)')
|
||||||
call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
if !empty(unloaded)
|
||||||
endfor
|
for name in unloaded
|
||||||
call s:dobufread(a:000)
|
call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
||||||
return 1
|
endfor
|
||||||
|
call s:dobufread(unloaded)
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:remove_triggers(name)
|
function! s:remove_triggers(name)
|
||||||
@@ -575,7 +579,7 @@ function! s:infer_properties(name, repo)
|
|||||||
let uri = repo
|
let uri = repo
|
||||||
else
|
else
|
||||||
if repo !~ '/'
|
if repo !~ '/'
|
||||||
let repo = 'vim-scripts/'. repo
|
throw printf('Invalid argument: %s (implicit `vim-scripts'' expansion is deprecated)', repo)
|
||||||
endif
|
endif
|
||||||
let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git')
|
let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git')
|
||||||
let uri = printf(fmt, repo)
|
let uri = printf(fmt, repo)
|
||||||
@@ -1063,7 +1067,7 @@ function! s:update_finish()
|
|||||||
elseif has_key(spec, 'tag')
|
elseif has_key(spec, 'tag')
|
||||||
let tag = spec.tag
|
let tag = spec.tag
|
||||||
if tag =~ '\*'
|
if tag =~ '\*'
|
||||||
let tags = s:lines(s:system('git tag --list '.string(tag).' --sort -version:refname 2>&1', spec.dir))
|
let tags = s:lines(s:system('git tag --list '.s:shellesc(tag).' --sort -version:refname 2>&1', spec.dir))
|
||||||
if !v:shell_error && !empty(tags)
|
if !v:shell_error && !empty(tags)
|
||||||
let tag = tags[0]
|
let tag = tags[0]
|
||||||
call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag))
|
call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag))
|
||||||
@@ -2022,7 +2026,7 @@ function! s:git_validate(spec, check_branch)
|
|||||||
" Check tag
|
" Check tag
|
||||||
if has_key(a:spec, 'tag')
|
if has_key(a:spec, 'tag')
|
||||||
let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir)
|
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.',
|
let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.',
|
||||||
\ (empty(tag) ? 'N/A' : tag), a:spec.tag)
|
\ (empty(tag) ? 'N/A' : tag), a:spec.tag)
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user