diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-06 22:46:32 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-06 22:46:32 +0000 |
commit | 8e71f82f8f4f0336ae74fe0e77398c27ea0c5309 (patch) | |
tree | 3aec99943a528f40b5c410420a0f4a9f56614889 /autoload | |
parent | 3cbf716d722cc03c833f49a40686d5bac0de7e16 (diff) | |
download | ale-8e71f82f8f4f0336ae74fe0e77398c27ea0c5309.zip |
#1006 Fix raw message handling for LSP support in NeoVim
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/job.vim | 17 |
1 files changed, 8 insertions, 9 deletions
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 |