1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-13 17:40:40 +08:00

Fix updated count

This commit is contained in:
wsdjeg 2017-04-15 22:15:13 +08:00
parent b756d06521
commit 1191ebf102

View File

@ -168,12 +168,13 @@ function! SpaceVim#plugins#manager#update(...) abort
return
endif
let s:pct = 0
let s:pct_done = 0
let s:plugins = a:0 == 0 ? sort(keys(dein#get())) : sort(copy(a:1))
if a:0 == 0
call add(s:plugins, 'SpaceVim')
endif
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')
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
call s:set_buf_line(s:plugin_manager_buffer, 3, '')
@ -215,12 +216,13 @@ endfunction
" here if a:data == 0, git pull succeed
function! s:on_pull_exit(id, data, event) abort
let s:pct_done += 1
if a:data == 0 && a:event ==# 'exit'
call s:msg_on_updated_done(s:pulling_repos[a:id].name)
else
call s:msg_on_updated_failed(s:pulling_repos[a:id].name)
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 remove(s:pulling_repos, string(a:id))
if !empty(s:plugins)
@ -260,7 +262,6 @@ endfunction
function! s:lock_revision(repo) abort
let cmd = ['git', '-C', a:repo.path, 'checkout', a:repo.rev]
let g:wsd = cmd
call s:VIM_CO.system(cmd)
endfunction