Skip to content

Commit 723e924

Browse files
authored
Merge pull request #1743 from Carpetsmoker/debug-err
Show debug errors as errors and not progress
2 parents 73c88fd + 1c308cb commit 723e924

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

autoload/go/debug.vim

+10-3
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,16 @@ function! s:start_cb(ch, json) abort
474474
exe bufwinnr(oldbuf) 'wincmd w'
475475
endfunction
476476

477-
function! s:starting(ch, msg) abort
477+
function! s:err_cb(ch, msg) abort
478+
call go#util#EchoError(a:msg)
479+
let s:state['message'] += [a:msg]
480+
endfunction
481+
482+
function! s:out_cb(ch, msg) abort
478483
call go#util#EchoProgress(a:msg)
479484
let s:state['message'] += [a:msg]
485+
486+
" TODO: why do this in this callback?
480487
if stridx(a:msg, g:go_debug_address) != -1
481488
call ch_setoptions(a:ch, {
482489
\ 'out_cb': function('s:logger', ['OUT: ']),
@@ -563,8 +570,8 @@ function! go#debug#Start(is_test, ...) abort
563570
call go#util#EchoProgress('Starting GoDebug...')
564571
let s:state['message'] = []
565572
let s:state['job'] = job_start(l:cmd, {
566-
\ 'out_cb': function('s:starting'),
567-
\ 'err_cb': function('s:starting'),
573+
\ 'out_cb': function('s:out_cb'),
574+
\ 'err_cb': function('s:err_cb'),
568575
\ 'exit_cb': function('s:exit'),
569576
\ 'stoponexit': 'kill',
570577
\})

0 commit comments

Comments
 (0)