From e455d8219e746856e0aa539712e010528ded8df0 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 14 Jun 2017 17:08:39 +0100 Subject: Fix #649 - Support tsserver linting for NeoVim --- autoload/ale/job.vim | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'autoload') diff --git a/autoload/ale/job.vim b/autoload/ale/job.vim index f4dc1252..b9ab86b7 100644 --- a/autoload/ale/job.vim +++ b/autoload/ale/job.vim @@ -24,7 +24,7 @@ function! s:KillHandler(timer) abort endfunction " Note that jobs and IDs are the same thing on NeoVim. -function! ale#job#JoinNeovimOutput(job, last_line, data, callback) abort +function! ale#job#JoinNeovimOutput(job, last_line, data, mode, callback) abort let l:lines = a:data[:-2] if len(a:data) > 1 @@ -34,9 +34,15 @@ function! ale#job#JoinNeovimOutput(job, last_line, data, callback) abort let l:new_last_line = a:last_line . a:data[0] endif - for l:line in l:lines - call a:callback(a:job, l:line) - endfor + if a:mode ==# 'raw' + if !empty(l:lines) + call a:callback(a:job, join(l:lines, "\n") . "\n") + endif + else + for l:line in l:lines + call a:callback(a:job, l:line) + endfor + endif return l:new_last_line endfunction @@ -49,6 +55,7 @@ function! s:NeoVimCallback(job, data, event) abort \ a:job, \ l:info.out_cb_line, \ a:data, + \ l:info.mode, \ ale#util#GetFunction(l:info.out_cb), \) elseif a:event ==# 'stderr' @@ -56,6 +63,7 @@ function! s:NeoVimCallback(job, data, event) abort \ a:job, \ l:info.err_cb_line, \ a:data, + \ l:info.mode, \ ale#util#GetFunction(l:info.err_cb), \) else -- cgit v1.2.3