Support reading from both output streams, and fix PHP error parsing, which sometimes logs to stderr, sometimes stdout.

This commit is contained in:
w0rp
2016-10-07 17:08:11 +01:00
parent f0f17e4b0d
commit d97e25a260
3 changed files with 17 additions and 5 deletions

View File

@@ -184,6 +184,12 @@ function! s:ApplyLinter(buffer, linter)
\ 'on_stderr': 's:GatherOutputNeoVim',
\ 'on_exit': 's:HandleExitNeoVim',
\})
elseif a:linter.output_stream ==# 'both'
let a:linter.job = jobstart(command, {
\ 'on_stdout': 's:GatherOutputNeoVim',
\ 'on_stderr': 's:GatherOutputNeoVim',
\ 'on_exit': 's:HandleExitNeoVim',
\})
else
let a:linter.job = jobstart(command, {
\ 'on_stdout': 's:GatherOutputNeoVim',
@@ -202,6 +208,10 @@ function! s:ApplyLinter(buffer, linter)
if a:linter.output_stream ==# 'stderr'
" Read from stderr instead of stdout.
let job_options.err_cb = function('s:GatherOutputVim')
elseif a:linter.output_stream ==# 'both'
" Read from both streams.
let job_options.out_cb = function('s:GatherOutputVim')
let job_options.err_cb = function('s:GatherOutputVim')
else
let job_options.out_cb = function('s:GatherOutputVim')
endif