@@ -371,15 +371,12 @@ endfunction
371
371
372
372
function ! s: postfix (request) abort
373
373
let pid = dispatch#pid (a: request )
374
- return ' (' . a: request .handler.' /' .(! empty (pid) ? pid : ' ?' ) . ' )'
374
+ let label = get (a: request , ' label' , ' Running' )
375
+ return ' (' . (! empty (pid) ? pid : ' ?' ) . ' /' . label . ' )'
375
376
endfunction
376
377
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 ' '
378
+ function ! s: quickfix_title (request) abort
379
+ return ' :Dispatch ' .dispatch#escape (a: request .expanded) . ' ' . s: postfix (a: request )
383
380
endfunction
384
381
385
382
function ! s: echo_truncated (left , right ) abort
@@ -1219,24 +1216,22 @@ function! dispatch#complete(file, ...) abort
1219
1216
endif
1220
1217
if has_key (request, ' aborted' )
1221
1218
echohl DispatchAbortedMsg
1222
- let label = ' Aborted: '
1219
+ let request. label = ' Aborted'
1223
1220
elseif status > 0
1224
1221
echohl DispatchFailureMsg
1225
- let label = ' Failure: '
1222
+ let request. label = ' Failure'
1226
1223
elseif status == 0
1227
1224
echohl DispatchSuccessMsg
1228
- let label = ' Success: '
1225
+ let request. label = ' Success'
1229
1226
else
1230
1227
echohl DispatchCompleteMsg
1231
- let label = ' Complete: '
1228
+ let request. label = ' Complete'
1232
1229
endif
1233
- let request.label = label
1234
- let request.status = status
1235
1230
if ! request.background && ! get (request, ' aborted' )
1236
1231
call s: cwindow (request, 0 , status, ' ' , ' make' )
1237
1232
redraw !
1238
1233
endif
1239
- call s: echo_truncated (label . ' !' , request.expanded . ' ' . s: postfix (request))
1234
+ call s: echo_truncated (' !' , request.expanded . ' ' . s: postfix (request))
1240
1235
echohl NONE
1241
1236
if ! a: 0
1242
1237
checktime
@@ -1316,18 +1311,18 @@ function! s:cgetfile(request, event, ...) abort
1316
1311
let &l: efm = request.format
1317
1312
endif
1318
1313
let &l: makeprg = dispatch#escape (request.expanded)
1319
- let title = ' :Dispatch ' .dispatch#escape (request.expanded) . ' ' . s: postfix (request)
1320
1314
if len (a: event )
1321
1315
exe ' silent doautocmd QuickFixCmdPre' a: event
1322
1316
endif
1323
- if exists (' :chistory' ) && stridx (get (getqflist ({' title' : 1 }), ' title' , ' ' ), title ) >= 0
1317
+ let title = s: quickfix_title (request)
1318
+ let title_to_match = title [: strridx (title , ' /' )]
1319
+ if exists (' :chistory' ) && stridx (get (getqflist ({' title' : 1 }), ' title' , ' ' ), title_to_match) >= 0
1324
1320
call setqflist ([], ' r' )
1325
1321
execute ' noautocmd caddfile' dispatch#fnameescape (request.file )
1326
1322
else
1327
1323
execute ' noautocmd cgetfile' dispatch#fnameescape (request.file )
1328
1324
endif
1329
1325
if exists (' :chistory' )
1330
- let title .= ' ' . s: status_label (request)
1331
1326
call setqflist ([], ' r' , {' title' : title })
1332
1327
endif
1333
1328
if len (a: event )
0 commit comments