From 40ef7a83a429664fd18f675d622fc3f36203daaa Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Mon, 23 Mar 2015 14:53:45 -0400 Subject: [PATCH] Interrupt jobs with proper buffer message. --- plug.vim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plug.vim b/plug.vim index e136a1c..9054cf0 100644 --- a/plug.vim +++ b/plug.vim @@ -603,6 +603,9 @@ function! s:prepare() xnoremap U :call status_update() nnoremap ]] :silent! call section('') nnoremap [[ :silent! call section('b') + if s:nvim + nnoremap :call job_abort(1) + 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')