Skip to content

Commit

Permalink
Merge pull request #1743 from Carpetsmoker/debug-err
Browse files Browse the repository at this point in the history
Show debug errors as errors and not progress
  • Loading branch information
fatih authored Mar 27, 2018
2 parents 73c88fd + 1c308cb commit 723e924
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions autoload/go/debug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,16 @@ function! s:start_cb(ch, json) abort
exe bufwinnr(oldbuf) 'wincmd w'
endfunction

function! s:starting(ch, msg) abort
function! s:err_cb(ch, msg) abort
call go#util#EchoError(a:msg)
let s:state['message'] += [a:msg]
endfunction

function! s:out_cb(ch, msg) abort
call go#util#EchoProgress(a:msg)
let s:state['message'] += [a:msg]

" TODO: why do this in this callback?
if stridx(a:msg, g:go_debug_address) != -1
call ch_setoptions(a:ch, {
\ 'out_cb': function('s:logger', ['OUT: ']),
Expand Down Expand Up @@ -563,8 +570,8 @@ function! go#debug#Start(is_test, ...) abort
call go#util#EchoProgress('Starting GoDebug...')
let s:state['message'] = []
let s:state['job'] = job_start(l:cmd, {
\ 'out_cb': function('s:starting'),
\ 'err_cb': function('s:starting'),
\ 'out_cb': function('s:out_cb'),
\ 'err_cb': function('s:err_cb'),
\ 'exit_cb': function('s:exit'),
\ 'stoponexit': 'kill',
\})
Expand Down

0 comments on commit 723e924

Please sign in to comment.