@@ -374,6 +374,14 @@ function! s:postfix(request) abort
374
374
return ' (' . a: request .handler.' /' .(! empty (pid) ? pid : ' ?' ) . ' )'
375
375
endfunction
376
376
377
+ function ! s: status_label (request) abort
378
+ let label = get (a: request , ' label' , ' ' ) . get (a: request , ' status' , ' ' )
379
+ if ! empty (label )
380
+ return ' (' . label . ' )'
381
+ endif
382
+ return ' '
383
+ endfunction
384
+
377
385
function ! s: echo_truncated (left , right ) abort
378
386
if exists (' v:echospace' )
379
387
let max_len = (&cmdheight - 1 ) * &columns + v: echospace
@@ -1209,10 +1217,6 @@ function! dispatch#complete(file, ...) abort
1209
1217
if ! a: 0
1210
1218
silent doautocmd ShellCmdPost
1211
1219
endif
1212
- if ! request.background && ! get (request, ' aborted' )
1213
- call s: cwindow (request, 0 , status, ' ' , ' make' )
1214
- redraw !
1215
- endif
1216
1220
if has_key (request, ' aborted' )
1217
1221
echohl DispatchAbortedMsg
1218
1222
let label = ' Aborted:'
@@ -1226,6 +1230,12 @@ function! dispatch#complete(file, ...) abort
1226
1230
echohl DispatchCompleteMsg
1227
1231
let label = ' Complete:'
1228
1232
endif
1233
+ let request.label = label
1234
+ let request.status = status
1235
+ if ! request.background && ! get (request, ' aborted' )
1236
+ call s: cwindow (request, 0 , status, ' ' , ' make' )
1237
+ redraw !
1238
+ endif
1229
1239
call s: echo_truncated (label . ' !' , request.expanded . ' ' . s: postfix (request))
1230
1240
echohl NONE
1231
1241
if ! a: 0
@@ -1310,13 +1320,14 @@ function! s:cgetfile(request, event, ...) abort
1310
1320
if len (a: event )
1311
1321
exe ' silent doautocmd QuickFixCmdPre' a: event
1312
1322
endif
1313
- if exists (' :chistory' ) && get (getqflist ({' title' : 1 }), ' title' , ' ' ) == # title
1323
+ if exists (' :chistory' ) && stridx ( get (getqflist ({' title' : 1 }), ' title' , ' ' ), title ) >= 0
1314
1324
call setqflist ([], ' r' )
1315
1325
execute ' noautocmd caddfile' dispatch#fnameescape (request.file )
1316
1326
else
1317
1327
execute ' noautocmd cgetfile' dispatch#fnameescape (request.file )
1318
1328
endif
1319
1329
if exists (' :chistory' )
1330
+ let title .= ' ' . s: status_label (request)
1320
1331
call setqflist ([], ' r' , {' title' : title })
1321
1332
endif
1322
1333
if len (a: event )
0 commit comments