mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 14:10:04 +08:00
pref(job): catch error from old jobstop
in latest version of neovim, `jobstop` will not print error when job id is invalid
This commit is contained in:
parent
8e63b529b7
commit
b3bcf07fba
@ -259,10 +259,15 @@ endfunction
|
|||||||
|
|
||||||
function! s:self.stop(id) abort dict
|
function! s:self.stop(id) abort dict
|
||||||
if self.nvim_job
|
if self.nvim_job
|
||||||
|
let done = 0
|
||||||
if has_key(self.jobs, a:id)
|
if has_key(self.jobs, a:id)
|
||||||
call jobstop(a:id)
|
try
|
||||||
|
let done = jobstop(a:id)
|
||||||
|
catch
|
||||||
|
endtry
|
||||||
call remove(self.jobs, a:id)
|
call remove(self.jobs, a:id)
|
||||||
endif
|
endif
|
||||||
|
return done
|
||||||
elseif self.vim_job
|
elseif self.vim_job
|
||||||
if has_key(self.jobs, a:id)
|
if has_key(self.jobs, a:id)
|
||||||
call job_stop(get(self.jobs, a:id))
|
call job_stop(get(self.jobs, a:id))
|
||||||
|
Loading…
Reference in New Issue
Block a user