upgrade plug
This commit is contained in:
@@ -337,7 +337,12 @@ function! s:err(msg)
|
|||||||
echohl ErrorMsg
|
echohl ErrorMsg
|
||||||
echom '[vim-plug] '.a:msg
|
echom '[vim-plug] '.a:msg
|
||||||
echohl None
|
echohl None
|
||||||
return 0
|
endfunction
|
||||||
|
|
||||||
|
function! s:warn(cmd, msg)
|
||||||
|
echohl WarningMsg
|
||||||
|
execute a:cmd 'a:msg'
|
||||||
|
echohl None
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:esc(path)
|
function! s:esc(path)
|
||||||
@@ -660,7 +665,7 @@ function! s:switch_out(...)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:finish_bindings()
|
function! s:finish_bindings()
|
||||||
nnoremap <silent> <buffer> R :silent! call <SID>retry()<cr>
|
nnoremap <silent> <buffer> R :call <SID>retry()<cr>
|
||||||
nnoremap <silent> <buffer> D :PlugDiff<cr>
|
nnoremap <silent> <buffer> D :PlugDiff<cr>
|
||||||
nnoremap <silent> <buffer> S :PlugStatus<cr>
|
nnoremap <silent> <buffer> S :PlugStatus<cr>
|
||||||
nnoremap <silent> <buffer> U :call <SID>status_update()<cr>
|
nnoremap <silent> <buffer> U :call <SID>status_update()<cr>
|
||||||
@@ -812,6 +817,7 @@ function! s:retry()
|
|||||||
if empty(s:update.errors)
|
if empty(s:update.errors)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
echo
|
||||||
call s:update_impl(s:update.pull, s:update.force,
|
call s:update_impl(s:update.pull, s:update.force,
|
||||||
\ extend(copy(s:update.errors), [s:update.threads]))
|
\ extend(copy(s:update.errors), [s:update.threads]))
|
||||||
endfunction
|
endfunction
|
||||||
@@ -824,6 +830,16 @@ function! s:names(...)
|
|||||||
return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)'))
|
return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)'))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:check_ruby()
|
||||||
|
silent! ruby require 'thread'; VIM::command('let g:plug_ruby = 1')
|
||||||
|
if get(g:, 'plug_ruby', 0)
|
||||||
|
unlet g:plug_ruby
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
redraw!
|
||||||
|
return s:warn('echom', 'Warning: Ruby interface is broken')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:update_impl(pull, force, args) abort
|
function! s:update_impl(pull, force, args) abort
|
||||||
let args = copy(a:args)
|
let args = copy(a:args)
|
||||||
let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ?
|
let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ?
|
||||||
@@ -834,10 +850,7 @@ function! s:update_impl(pull, force, args) abort
|
|||||||
\ filter(managed, 'index(args, v:key) >= 0')
|
\ filter(managed, 'index(args, v:key) >= 0')
|
||||||
|
|
||||||
if empty(todo)
|
if empty(todo)
|
||||||
echohl WarningMsg
|
return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install'))
|
||||||
echo 'No plugin to '. (a:pull ? 'update' : 'install') . '.'
|
|
||||||
echohl None
|
|
||||||
return
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !s:is_win && s:git_version_requirement(2, 3)
|
if !s:is_win && s:git_version_requirement(2, 3)
|
||||||
@@ -859,13 +872,11 @@ function! s:update_impl(pull, force, args) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if has('nvim') && !exists('*jobwait') && threads > 1
|
if has('nvim') && !exists('*jobwait') && threads > 1
|
||||||
echohl WarningMsg
|
call s:warn('echom', '[vim-plug] Update Neovim for parallel installer')
|
||||||
echomsg 'vim-plug: update Neovim for parallel installer'
|
|
||||||
echohl None
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let python = (has('python') || has('python3')) && (!s:nvim || has('vim_starting'))
|
let python = (has('python') || has('python3')) && (!s:nvim || has('vim_starting'))
|
||||||
let ruby = has('ruby') && !s:nvim && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running'))
|
let ruby = has('ruby') && !s:nvim && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && s:check_ruby()
|
||||||
|
|
||||||
let s:update = {
|
let s:update = {
|
||||||
\ 'start': reltime(),
|
\ 'start': reltime(),
|
||||||
@@ -1088,7 +1099,6 @@ function! s:logpos(name)
|
|||||||
return i
|
return i
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
return 0
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:log(bullet, name, lines)
|
function! s:log(bullet, name, lines)
|
||||||
@@ -1424,7 +1434,7 @@ class Plugin(object):
|
|||||||
self.write(Action.DONE, self.name, result[-1:])
|
self.write(Action.DONE, self.name, result[-1:])
|
||||||
|
|
||||||
def repo_uri(self):
|
def repo_uri(self):
|
||||||
cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url'
|
cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url'
|
||||||
command = Command(cmd, self.args['dir'], G_TIMEOUT,)
|
command = Command(cmd, self.args['dir'], G_TIMEOUT,)
|
||||||
result = command.execute(G_RETRIES)
|
result = command.execute(G_RETRIES)
|
||||||
return result[-1]
|
return result[-1]
|
||||||
@@ -1725,7 +1735,7 @@ function! s:update_ruby()
|
|||||||
ok, result =
|
ok, result =
|
||||||
if exists
|
if exists
|
||||||
chdir = "#{cd} #{iswin ? dir : esc(dir)}"
|
chdir = "#{cd} #{iswin ? dir : esc(dir)}"
|
||||||
ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url", nil, nil, nil
|
ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil
|
||||||
current_uri = data.lines.to_a.last
|
current_uri = data.lines.to_a.last
|
||||||
if !ret
|
if !ret
|
||||||
if data =~ /^Interrupted|^Timeout/
|
if data =~ /^Interrupted|^Timeout/
|
||||||
@@ -1818,7 +1828,7 @@ endfunction
|
|||||||
function! s:git_validate(spec, check_branch)
|
function! s:git_validate(spec, check_branch)
|
||||||
let err = ''
|
let err = ''
|
||||||
if isdirectory(a:spec.dir)
|
if isdirectory(a:spec.dir)
|
||||||
let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url', a:spec.dir))
|
let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url', a:spec.dir))
|
||||||
let remote = result[-1]
|
let remote = result[-1]
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
let err = join([remote, 'PlugClean required.'], "\n")
|
let err = join([remote, 'PlugClean required.'], "\n")
|
||||||
@@ -2026,7 +2036,6 @@ function! s:is_preview_window_open()
|
|||||||
wincmd p
|
wincmd p
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
return 0
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:find_name(lnum)
|
function! s:find_name(lnum)
|
||||||
|
|||||||
Reference in New Issue
Block a user