From 8e71f82f8f4f0336ae74fe0e77398c27ea0c5309 Mon Sep 17 00:00:00 2001 From: w0rp Date: Mon, 6 Nov 2017 22:46:32 +0000 Subject: #1006 Fix raw message handling for LSP support in NeoVim --- autoload/ale/job.vim | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'autoload') diff --git a/autoload/ale/job.vim b/autoload/ale/job.vim index 0f6b8577..e6a75c88 100644 --- a/autoload/ale/job.vim +++ b/autoload/ale/job.vim @@ -25,6 +25,11 @@ endfunction " Note that jobs and IDs are the same thing on NeoVim. function! ale#job#JoinNeovimOutput(job, last_line, data, mode, callback) abort + if a:mode is# 'raw' + call a:callback(a:job, join(a:data, "\n")) + return '' + endif + let l:lines = a:data[:-2] if len(a:data) > 1 @@ -34,15 +39,9 @@ function! ale#job#JoinNeovimOutput(job, last_line, data, mode, callback) abort let l:new_last_line = a:last_line . a:data[0] endif - if a:mode is# '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 + for l:line in l:lines + call a:callback(a:job, l:line) + endfor return l:new_last_line endfunction -- cgit v1.2.3