Skip to content

Commit 3a2cef1

Browse files
hiberabyssbhcleek
authored andcommitted
improve quickfix and title when go_term_enabled is set
* set the title to the result of joining the elements of the list when the command is a list. * strip trailing carriage returns from error messages.
1 parent 1b98bd8 commit 3a2cef1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

autoload/go/term.vim

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
" new creates a new terminal with the given command. Mode is set based on the
2+
List: 3 |v:t_list|
23
" global variable g:go_term_mode, which is by default set to :vsplit
34
function! go#term#new(bang, cmd) abort
45
return go#term#newmode(a:bang, a:cmd, go#config#TermMode())
@@ -90,7 +91,11 @@ function! s:on_exit(job_id, exit_status, event) dict abort
9091

9192
call win_gotoid(self.winid)
9293

93-
call go#list#Populate(l:listtype, errors, self.cmd)
94+
let title = self.cmd
95+
if type(title) == v:t_list
96+
let title = join(self.cmd)
97+
endif
98+
call go#list#Populate(l:listtype, errors, title)
9499
call go#list#Window(l:listtype, len(errors))
95100
if !self.bang
96101
call go#list#JumpToFirst(l:listtype)

autoload/go/tool.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function! go#tool#ParseErrors(lines) abort
118118
" Preserve indented lines.
119119
" This comes up especially with multi-line test output.
120120
if match(line, '^\s') >= 0
121-
call add(errors, {"text": line})
121+
call add(errors, {"text": substitute(line, '\r$', '', '')})
122122
endif
123123
endif
124124
endfor

0 commit comments

Comments
 (0)