From 6a442dae6e3a1e578205aa431139242a0b5a0ad6 Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 27 Sep 2016 15:06:26 +0100 Subject: Fix a bug with reading from large files. Large files we being truncated by closing the input buffer too early. --- plugin/ale/zmain.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugin') diff --git a/plugin/ale/zmain.vim b/plugin/ale/zmain.vim index 8ec1c955..4cef1ab7 100644 --- a/plugin/ale/zmain.vim +++ b/plugin/ale/zmain.vim @@ -40,6 +40,12 @@ function! s:ClearJob(job) if has('nvim') call jobstop(a:job) else + " We must close the channel for reading the buffer if it is open + " when stopping a job. Otherwise, we will get errors in the status line. + if ch_status(job_getchannel(a:job)) ==# 'open' + call ch_close_in(job_getchannel(a:job)) + endif + call job_stop(a:job) endif @@ -175,8 +181,6 @@ function! s:ApplyLinter(buffer, linter) " Vim 8 will read the stdin from the file's buffer. let a:linter.job = job_start(l:command, l:job_options) - - call ch_close_in(job_getchannel(a:linter.job)) endif let s:job_info_map[a:linter.job] = { -- cgit v1.2.3