Detect abnormal process exit using 'Error' line
This commit is contained in:
parent
8c915a5271
commit
385a1eb350
7
plug.vim
7
plug.vim
|
@ -758,6 +758,10 @@ function! s:job_handler() abort
|
||||||
|
|
||||||
if v:job_data[1] == 'exit'
|
if v:job_data[1] == 'exit'
|
||||||
let job.running = 0
|
let job.running = 0
|
||||||
|
if s:lastline(job.result) ==# 'Error'
|
||||||
|
let job.error = 1
|
||||||
|
let job.result = substitute(job.result, "Error[\r\n]$", '', '')
|
||||||
|
endif
|
||||||
call s:reap(name)
|
call s:reap(name)
|
||||||
call s:tick()
|
call s:tick()
|
||||||
else
|
else
|
||||||
|
@ -777,7 +781,8 @@ function! s:spawn(name, cmd, opts)
|
||||||
|
|
||||||
if s:nvim
|
if s:nvim
|
||||||
let x = jobstart(a:name, 'sh', ['-c',
|
let x = jobstart(a:name, 'sh', ['-c',
|
||||||
\ has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd])
|
\ (has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd)
|
||||||
|
\ . ' || echo Error'])
|
||||||
if x > 0
|
if x > 0
|
||||||
let s:jobs_idx[x] = a:name
|
let s:jobs_idx[x] = a:name
|
||||||
let job.jobid = x
|
let job.jobid = x
|
||||||
|
|
Loading…
Reference in New Issue
Block a user