summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2016-09-27 15:06:26 +0100
committerw0rp <devw0rp@gmail.com>2016-09-27 15:06:26 +0100
commit6a442dae6e3a1e578205aa431139242a0b5a0ad6 (patch)
tree89d1fc678e71519f7dee9348a25a94cb69385ef9 /plugin
parentfacc3a89b403f14f0549a5612da85aa76b6c2527 (diff)
downloadale-6a442dae6e3a1e578205aa431139242a0b5a0ad6.zip
Fix a bug with reading from large files. Large files we being truncated by closing the input buffer too early.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ale/zmain.vim8
1 files changed, 6 insertions, 2 deletions
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] = {