This commit is contained in:
Junegunn Choi 2024-07-09 20:01:59 +09:00
parent 72f3455214
commit 118876ffcf
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -1330,6 +1330,11 @@ function! s:update_finish()
endif endif
endfunction endfunction
function! s:mark_aborted(name, message)
let attrs = { 'running': 0, 'error': 1, 'abort': 1, 'lines': [a:message] }
let s:jobs[a:name] = extend(get(s:jobs, a:name, {}), attrs)
endfunction
function! s:job_abort(cancel) function! s:job_abort(cancel)
if (!s:nvim && !s:vim8) || !exists('s:jobs') if (!s:nvim && !s:vim8) || !exists('s:jobs')
return return
@ -1344,7 +1349,9 @@ function! s:job_abort(cancel)
if j.new if j.new
call s:rm_rf(g:plugs[name].dir) call s:rm_rf(g:plugs[name].dir)
endif endif
let s:jobs[name] = { 'running': 0, 'lines': ['Aborted'], 'error': 1, 'abort': 1 } if a:cancel
call s:mark_aborted(name, 'Aborted')
endif
endfor endfor
if a:cancel if a:cancel
@ -1562,7 +1569,7 @@ while 1 " Without TCO, Vim stack is bound to explode
let name = keys(s:update.todo)[0] let name = keys(s:update.todo)[0]
let spec = remove(s:update.todo, name) let spec = remove(s:update.todo, name)
if get(spec, 'abort', 0) if get(spec, 'abort', 0)
let s:jobs[name] = { 'running': 0, 'lines': ['Skipped'], 'abort': 1, 'error': 1 } call s:mark_aborted(name, 'Skipped')
call s:reap(name) call s:reap(name)
continue continue
endif endif