From a8c83a097b54da0b6525f57d7d8eac69002dcec5 Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 13 Oct 2016 15:13:11 +0100 Subject: [PATCH] #107 - Handle jobs finishing for closed buffers --- autoload/ale/engine.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/ale/engine.vim b/autoload/ale/engine.vim index e29f3fda..42c2f750 100644 --- a/autoload/ale/engine.vim +++ b/autoload/ale/engine.vim @@ -78,6 +78,11 @@ function! s:HandleExit(job) abort let l:output = l:job_info.output let l:buffer = l:job_info.buffer + if bufwinnr(l:buffer) == -1 + " A job ended for a buffer which has been closed, so stop here. + return + endif + let l:linter_loclist = ale#util#GetFunction(l:linter.callback)(l:buffer, l:output) " Make some adjustments to the loclists to fix common problems.