Skip to content

Commit

Permalink
Do NOT raise E900 on invalid jobid
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdalisue authored and prabirshrestha committed Jul 18, 2019
1 parent f301455 commit 91c3f2b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion autoload/async/job.vim
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,14 @@ function! s:job_stop(jobid) abort
if has_key(s:jobs, a:jobid)
let l:jobinfo = s:jobs[a:jobid]
if l:jobinfo.type == s:job_type_nvimjob
call jobstop(a:jobid)
" See: vital-Whisky/System.Job
try
call jobstop(a:jobid)
catch /^Vim\%((\a\+)\)\=:E900/
" NOTE:
" Vim does not raise exception even the job has already closed so fail
" silently for 'E900: Invalid job id' exception
endtry
elseif l:jobinfo.type == s:job_type_vimjob
call job_stop(s:jobs[a:jobid].job)
endif
Expand Down

0 comments on commit 91c3f2b

Please sign in to comment.