Merge d85465cb7e
into c88ab60007
This commit is contained in:
commit
f388be1782
27
plug.vim
27
plug.vim
|
@ -112,14 +112,17 @@ function! plug#begin(...)
|
|||
return 1
|
||||
endfunction
|
||||
|
||||
function! s:define_commands()
|
||||
command! -nargs=+ -bar Plug call s:add(<args>)
|
||||
function! s:git_exists()
|
||||
if !executable('git')
|
||||
return s:err('`git` executable not found. vim-plug requires git.')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:define_commands()
|
||||
command! -nargs=+ -bar Plug call s:add(<args>)
|
||||
command! -nargs=0 -bar -bang PlugClean call s:clean(<bang>0)
|
||||
command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(<bang>0, [<f-args>])
|
||||
command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(<bang>0, [<f-args>])
|
||||
command! -nargs=0 -bar -bang PlugClean call s:clean(<bang>0)
|
||||
command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif
|
||||
command! -nargs=0 -bar PlugStatus call s:status()
|
||||
command! -nargs=0 -bar PlugDiff call s:diff()
|
||||
|
@ -776,6 +779,10 @@ function! s:names(...)
|
|||
endfunction
|
||||
|
||||
function! s:update_impl(pull, force, args) abort
|
||||
if !s:git_exists()
|
||||
return
|
||||
endif
|
||||
|
||||
let args = copy(a:args)
|
||||
let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ?
|
||||
\ remove(args, -1) : get(g:, 'plug_threads', 16)
|
||||
|
@ -1847,6 +1854,10 @@ function! s:clean(force)
|
|||
endfunction
|
||||
|
||||
function! s:upgrade()
|
||||
if !s:git_exists()
|
||||
return
|
||||
endif
|
||||
|
||||
echo 'Downloading the latest version of vim-plug'
|
||||
redraw
|
||||
let tmp = tempname()
|
||||
|
@ -1880,6 +1891,9 @@ function! s:upgrade_specs()
|
|||
endfunction
|
||||
|
||||
function! s:status()
|
||||
if !s:git_exists()
|
||||
return
|
||||
endif
|
||||
call s:prepare()
|
||||
call append(0, 'Checking plugins')
|
||||
call append(1, '')
|
||||
|
@ -2012,6 +2026,9 @@ function! s:append_ul(lnum, text)
|
|||
endfunction
|
||||
|
||||
function! s:diff()
|
||||
if !s:git_exists()
|
||||
return
|
||||
endif
|
||||
call s:prepare()
|
||||
call append(0, ['Collecting changes ...', ''])
|
||||
let cnts = [0, 0]
|
||||
|
@ -2071,6 +2088,9 @@ function! s:revert()
|
|||
endfunction
|
||||
|
||||
function! s:snapshot(force, ...) abort
|
||||
if !s:git_exists()
|
||||
return
|
||||
endif
|
||||
call s:prepare()
|
||||
setf vim
|
||||
call append(0, ['" Generated by vim-plug',
|
||||
|
@ -2117,4 +2137,3 @@ endif
|
|||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user