Upgraded vim-plug plugin
via :PlugUpgrade
This commit is contained in:
@@ -372,8 +372,10 @@ function! plug#end()
|
|||||||
|
|
||||||
for [cmd, names] in items(lod.cmd)
|
for [cmd, names] in items(lod.cmd)
|
||||||
execute printf(
|
execute printf(
|
||||||
\ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)',
|
\ has('patch-7.4.1898')
|
||||||
\ cmd, string(cmd), string(names))
|
\ ? 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, <q-mods> ,%s)'
|
||||||
|
\ : 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)'
|
||||||
|
\ , cmd, string(cmd), string(names))
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
for [map, names] in items(lod.map)
|
for [map, names] in items(lod.map)
|
||||||
@@ -651,11 +653,19 @@ function! s:lod_ft(pat, names)
|
|||||||
call s:doautocmd('filetypeindent', 'FileType')
|
call s:doautocmd('filetypeindent', 'FileType')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:lod_cmd(cmd, bang, l1, l2, args, names)
|
if has('patch-7.4.1898')
|
||||||
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
function! s:lod_cmd(cmd, bang, l1, l2, args, mods, names)
|
||||||
call s:dobufread(a:names)
|
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
||||||
execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
|
call s:dobufread(a:names)
|
||||||
endfunction
|
execute printf('%s %s%s%s %s', a:mods, (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
|
||||||
|
endfunction
|
||||||
|
else
|
||||||
|
function! s:lod_cmd(cmd, bang, l1, l2, args, names)
|
||||||
|
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
||||||
|
call s:dobufread(a:names)
|
||||||
|
execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
function! s:lod_map(map, names, with_prefix, prefix)
|
function! s:lod_map(map, names, with_prefix, prefix)
|
||||||
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
||||||
@@ -1075,12 +1085,16 @@ function! s:hash_match(a, b)
|
|||||||
return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0
|
return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:disable_credential_helper()
|
||||||
|
return s:git_version_requirement(2) && get(g:, 'plug_disable_credential_helper', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:checkout(spec)
|
function! s:checkout(spec)
|
||||||
let sha = a:spec.commit
|
let sha = a:spec.commit
|
||||||
let output = s:git_revision(a:spec.dir)
|
let output = s:git_revision(a:spec.dir)
|
||||||
let error = 0
|
let error = 0
|
||||||
if !empty(output) && !s:hash_match(sha, s:lines(output)[0])
|
if !empty(output) && !s:hash_match(sha, s:lines(output)[0])
|
||||||
let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : ''
|
let credential_helper = s:disable_credential_helper() ? '-c credential.helper= ' : ''
|
||||||
let output = s:system(
|
let output = s:system(
|
||||||
\ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir)
|
\ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir)
|
||||||
let error = v:shell_error
|
let error = v:shell_error
|
||||||
@@ -1589,7 +1603,7 @@ while 1 " Without TCO, Vim stack is bound to explode
|
|||||||
let [error, _] = s:git_validate(spec, 0)
|
let [error, _] = s:git_validate(spec, 0)
|
||||||
if empty(error)
|
if empty(error)
|
||||||
if pull
|
if pull
|
||||||
let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch']
|
let cmd = s:disable_credential_helper() ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch']
|
||||||
if has_tag && !empty(globpath(spec.dir, '.git/shallow'))
|
if has_tag && !empty(globpath(spec.dir, '.git/shallow'))
|
||||||
call extend(cmd, ['--depth', '99999999'])
|
call extend(cmd, ['--depth', '99999999'])
|
||||||
endif
|
endif
|
||||||
|
|||||||
2863
.vim/autoload/plug.vim.old
Normal file
2863
.vim/autoload/plug.vim.old
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user