Avoid possible hang on failure to start job

References: https://github.com/tpope/vim-fugitive/issues/1751
This commit is contained in:
Tim Pope
2021-05-28 17:19:06 -04:00
parent 6ae064c5aa
commit 9871822dd5

View File

@@ -2663,7 +2663,7 @@ function! s:RunTick(job) abort
if type(a:job) == v:t_number if type(a:job) == v:t_number
return jobwait([a:job], 1)[0] == -1 return jobwait([a:job], 1)[0] == -1
elseif type(a:job) == 8 elseif type(a:job) == 8
let running = ch_status(a:job) !=# 'closed' || job_status(a:job) ==# 'run' let running = ch_status(a:job) !~# '^closed$\|^failed$' || job_status(a:job) ==# 'run'
sleep 1m sleep 1m
return running return running
endif endif