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

Update job api

This commit is contained in:
Shidong Wang 2018-12-30 15:50:58 +08:00
parent bc59abdaea
commit ccab94968a

View File

@ -197,7 +197,7 @@ function! s:self.stop(id) abort
call jobstop(a:id) call jobstop(a:id)
call remove(self.jobs, a:id) call remove(self.jobs, a:id)
else else
call self.warn('No job with such id') call self.warn('[job API] Failed to stop job :' . a:id)
endif endif
elseif self.vim_job elseif self.vim_job
if has_key(self.jobs, a:id) if has_key(self.jobs, a:id)
@ -218,7 +218,7 @@ function! s:self.send(id, data) abort
call jobsend(a:id, a:data) call jobsend(a:id, a:data)
endif endif
else else
call self.warn('No job with such id') call self.warn('[job API] Failed to send data to job: ' . a:id)
endif endif
elseif self.vim_job elseif self.vim_job
if has_key(self.jobs, a:id) if has_key(self.jobs, a:id)
@ -230,7 +230,7 @@ function! s:self.send(id, data) abort
call ch_sendraw(chanel, join(a:data, "\n")) call ch_sendraw(chanel, join(a:data, "\n"))
endif endif
else else
call self.warn('No job with such id') call self.warn('[job API] Failed to send data to job: ' . a:id)
endif endif
else else
call self.warn() call self.warn()
@ -247,7 +247,7 @@ function! s:self.status(id) abort
return job_status(get(self.jobs, a:id)) return job_status(get(self.jobs, a:id))
endif endif
else else
call self.warn('No job with such id!') call self.warn('[job API] Failed to get job status: ' . a:id)
endif endif
endfunction endfunction
@ -265,7 +265,7 @@ function! s:self.info(id) abort
if has_key(self.jobs, a:id) if has_key(self.jobs, a:id)
return job_info(get(self.jobs, a:id)) return job_info(get(self.jobs, a:id))
else else
call self.warn('No job with such id!') call self.warn('[job API] Failed to get job info: ' . a:id)
endif endif
else else
call self.warn() call self.warn()