update plugin manager

This commit is contained in:
Nico 2021-03-26 09:07:26 +00:00
parent ac783f4b2a
commit d2c8a7ff48
1 changed files with 15 additions and 4 deletions

View File

@ -804,7 +804,7 @@ function! s:syntax()
syn match plugNumber /[0-9]\+[0-9.]*/ contained
syn match plugBracket /[[\]]/ contained
syn match plugX /x/ contained
syn match plugDash /^-/
syn match plugDash /^-\{1}\ /
syn match plugPlus /^+/
syn match plugStar /^*/
syn match plugMessage /\(^- \)\@<=.*/
@ -822,6 +822,7 @@ function! s:syntax()
syn match plugError /^x.*/
syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/
syn match plugH2 /^.*:\n-\+$/
syn match plugH2 /^-\{2,}/
syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean
hi def link plug1 Title
hi def link plug2 Repeat
@ -934,7 +935,7 @@ function! s:prepare(...)
call s:new_window()
endif
nnoremap <silent> <buffer> q :if b:plug_preview==1<bar>pc<bar>endif<bar>bd<cr>
nnoremap <silent> <buffer> q :call <SID>close_pane()<cr>
if a:0 == 0
call s:finish_bindings()
endif
@ -956,6 +957,15 @@ function! s:prepare(...)
endif
endfunction
function! s:close_pane()
if b:plug_preview == 1
pc
let b:plug_preview = -1
else
bd
endif
endfunction
function! s:assign_name()
" Assign buffer name
let prefix = '[Plugins]'
@ -1077,8 +1087,9 @@ function! s:checkout(spec)
let sha = a:spec.commit
let output = s:git_revision(a:spec.dir)
if !empty(output) && !s:hash_match(sha, s:lines(output)[0])
let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : ''
let output = s:system(
\ 'git 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)
endif
return output
endfunction
@ -1530,7 +1541,7 @@ while 1 " Without TCO, Vim stack is bound to explode
let [error, _] = s:git_validate(spec, 0)
if empty(error)
if pull
let cmd = ['git', 'fetch']
let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch']
if has_tag && !empty(globpath(spec.dir, '.git/shallow'))
call extend(cmd, ['--depth', '99999999'])
endif