mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:50:06 +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
|
||||
if self.nvim_job
|
||||
let done = 0
|
||||
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)
|
||||
endif
|
||||
return done
|
||||
elseif self.vim_job
|
||||
if has_key(self.jobs, a:id)
|
||||
call job_stop(get(self.jobs, a:id))
|
||||
|
Loading…
Reference in New Issue
Block a user