1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 20:30:05 +08:00

fix(job): fix job api

This commit is contained in:
wsdjeg 2023-03-28 13:49:07 +08:00
parent 73cf51975b
commit 24dba7b23e

View File

@ -140,7 +140,11 @@ function! s:self.warp_nvim(argv, opts) abort dict
endfunction
function! obj.__on_exit(id, data, event) abort dict
if has_key(self._opts, 'on_exit')
let self._jobs[a:id][1] = a:data ? 'failed' : 'dead'
if has_key(self._jobs, a:id)
" when run JOB.stop(id), it will be removed from _jobs before
" __on_exit function called.
let self._jobs[a:id][1] = a:data ? 'failed' : 'dead'
endif
call self._opts.on_exit(a:id, a:data, 'exit')
endif
endfunction