Simplify job cleanup code

This commit is contained in:
w0rp
2017-06-06 16:44:01 +01:00
parent a0e0408ecc
commit 3c5156d4a4
4 changed files with 33 additions and 47 deletions

View File

@@ -268,12 +268,16 @@ endfunction
" Given a Job ID, stop that job.
" Invalid job IDs will be ignored.
function! ale#job#Stop(job_id) abort
if !has_key(s:job_map, a:job_id)
return
endif
if has('nvim')
" FIXME: NeoVim kills jobs on a timer, but will not kill any processes
" which are child processes on Unix. Some work needs to be done to
" kill child processes to stop long-running processes like pylint.
call jobstop(a:job_id)
elseif has_key(s:job_map, a:job_id)
else
let l:job = s:job_map[a:job_id].job
" We must close the channel for reading the buffer if it is open