diff --git a/autoload/go/cmd.vim b/autoload/go/cmd.vim index 87312806d9..8095086a77 100644 --- a/autoload/go/cmd.vim +++ b/autoload/go/cmd.vim @@ -195,6 +195,9 @@ function! go#cmd#Test(bang, compile, ...) call go#list#Window(len(errors)) if !empty(errors) && !a:bang call go#list#JumpToFirst() + elseif empty(errors) + " failed to parse errors, output the original content + call go#util#EchoError(out) endif echon "vim-go: " | echohl ErrorMsg | echon "[test] FAIL" | echohl None else diff --git a/autoload/go/jobcontrol.vim b/autoload/go/jobcontrol.vim index f8576a2c45..442dc1c1ac 100644 --- a/autoload/go/jobcontrol.vim +++ b/autoload/go/jobcontrol.vim @@ -93,7 +93,7 @@ endfunction " it'll be closed. function! s:on_exit(job_id, data) let std_combined = self.stderr + self.stdout - if empty(std_combined) + if a:data == 0 call go#list#Clean() call go#list#Window() @@ -101,20 +101,17 @@ function! s:on_exit(job_id, data) return endif + let self.state = "FAILED" + let errors = go#tool#ParseErrors(std_combined) let errors = go#tool#FilterValids(errors) if !len(errors) - " no errors could be past, just return - call go#list#Clean() - call go#list#Window() - - let self.state = "SUCCESS" + " failed to parse errors, output the original content + call go#util#EchoError(std_combined[0]) return endif - let self.state = "FAILED" - " if we are still in the same windows show the list if self.winnr == winnr() call go#list#Populate(errors)