mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-15 08:00:40 +08:00
Fix updated count
This commit is contained in:
parent
b756d06521
commit
1191ebf102
@ -168,12 +168,13 @@ function! SpaceVim#plugins#manager#update(...) abort
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let s:pct = 0
|
let s:pct = 0
|
||||||
|
let s:pct_done = 0
|
||||||
let s:plugins = a:0 == 0 ? sort(keys(dein#get())) : sort(copy(a:1))
|
let s:plugins = a:0 == 0 ? sort(keys(dein#get())) : sort(copy(a:1))
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
call add(s:plugins, 'SpaceVim')
|
call add(s:plugins, 'SpaceVim')
|
||||||
endif
|
endif
|
||||||
let s:total = len(s:plugins)
|
let s:total = len(s:plugins)
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct . '/' . s:total . ')')
|
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')')
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 3, '')
|
call s:set_buf_line(s:plugin_manager_buffer, 3, '')
|
||||||
@ -215,12 +216,13 @@ endfunction
|
|||||||
|
|
||||||
" here if a:data == 0, git pull succeed
|
" here if a:data == 0, git pull succeed
|
||||||
function! s:on_pull_exit(id, data, event) abort
|
function! s:on_pull_exit(id, data, event) abort
|
||||||
|
let s:pct_done += 1
|
||||||
if a:data == 0 && a:event ==# 'exit'
|
if a:data == 0 && a:event ==# 'exit'
|
||||||
call s:msg_on_updated_done(s:pulling_repos[a:id].name)
|
call s:msg_on_updated_done(s:pulling_repos[a:id].name)
|
||||||
else
|
else
|
||||||
call s:msg_on_updated_failed(s:pulling_repos[a:id].name)
|
call s:msg_on_updated_failed(s:pulling_repos[a:id].name)
|
||||||
endif
|
endif
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct . '/' . s:total . ')')
|
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')')
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
||||||
call remove(s:pulling_repos, string(a:id))
|
call remove(s:pulling_repos, string(a:id))
|
||||||
if !empty(s:plugins)
|
if !empty(s:plugins)
|
||||||
@ -260,7 +262,6 @@ endfunction
|
|||||||
|
|
||||||
function! s:lock_revision(repo) abort
|
function! s:lock_revision(repo) abort
|
||||||
let cmd = ['git', '-C', a:repo.path, 'checkout', a:repo.rev]
|
let cmd = ['git', '-C', a:repo.path, 'checkout', a:repo.rev]
|
||||||
let g:wsd = cmd
|
|
||||||
call s:VIM_CO.system(cmd)
|
call s:VIM_CO.system(cmd)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user