Skip to content

Commit f56b761

Browse files
committed
Allow checking run status without handler
1 parent 6394219 commit f56b761

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

autoload/dispatch.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ function! dispatch#spawn(command, ...) abort
316316
let key = request.directory."\t".substitute(request.expanded, '\s*$', '', '')
317317
let i = 0
318318
while i < len(get(g:DISPATCH_STARTS, key, []))
319-
let [handler, pid] = split(g:DISPATCH_STARTS[key][i], '@')
320-
if !s:running(handler, pid)
319+
let [handler, pid] = split(g:DISPATCH_STARTS[key][i], '[@/]')
320+
if !s:running(pid, handler)
321321
call remove(g:DISPATCH_STARTS[key], i)
322322
continue
323323
endif
@@ -346,7 +346,7 @@ function! dispatch#spawn(command, ...) abort
346346
if !has_key(g:DISPATCH_STARTS, key)
347347
let g:DISPATCH_STARTS[key] = []
348348
endif
349-
call add(g:DISPATCH_STARTS[key], request.handler.'@'.dispatch#pid(request))
349+
call add(g:DISPATCH_STARTS[key], request.handler.'/'.dispatch#pid(request))
350350
endif
351351
else
352352
execute '!' . request.command
@@ -742,11 +742,11 @@ function! dispatch#request(...) abort
742742
return s:request(a:0 ? a:1 : 0)
743743
endfunction
744744

745-
function! s:running(handler, pid) abort
745+
function! s:running(pid, ...) abort
746746
if empty(a:pid)
747747
return 0
748-
elseif exists('*dispatch#'.a:handler.'#running')
749-
return dispatch#{a:handler}#running(a:pid)
748+
elseif a:0 && exists('*dispatch#'.a:1.'#running')
749+
return dispatch#{a:1}#running(a:pid)
750750
elseif has('win32')
751751
let tasklist_cmd = 'tasklist /fi "pid eq '.a:pid.'"'
752752
if &shellxquote ==# '"'

0 commit comments

Comments
 (0)