Interrupt jobs with proper buffer message.

This commit is contained in:
Jeremy Pallats/starcraft.man 2015-03-23 14:53:45 -04:00
parent cf1f644aa8
commit 40ef7a83a4

View File

@ -603,6 +603,9 @@ function! s:prepare()
xnoremap <silent> <buffer> U :call <SID>status_update()<cr>
nnoremap <silent> <buffer> ]] :silent! call <SID>section('')<cr>
nnoremap <silent> <buffer> [[ :silent! call <SID>section('b')<cr>
if s:nvim
nnoremap <silent> <buffer> <C-C> :call <SID>job_abort(1)<cr>
endif
let b:plug_preview = -1
let s:plug_tab = tabpagenr()
let s:plug_buf = winbufnr(0)
@ -814,7 +817,7 @@ function! s:update_finish()
endif
endfunction
function! s:job_abort()
function! s:job_abort(...)
if !s:nvim || !exists('s:jobs')
return
endif
@ -826,6 +829,9 @@ function! s:job_abort()
if j.new
call s:system('rm -rf ' . s:shellesc(g:plugs[name].dir))
endif
if len(a:000) != 0
call s:log('x', name, "Interrupted!\n")
endif
endfor
let s:jobs = {}
endfunction
@ -1611,7 +1617,7 @@ function! s:compare_git_uri(a, b)
endfunction
function! s:format_message(bullet, name, message)
if a:bullet != 'x'
if a:bullet != 'x' || a:message == "Interrupted!\n"
return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))]
else
let lines = map(s:lines(a:message), '" ".v:val')