Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the filename in the location-list #1199

Merged
merged 1 commit into from
Feb 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions autoload/go/fmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function! go#fmt#Format(withGoimport) abort
if go#util#ShellError() == 0
call go#fmt#update_file(l:tmpname, expand('%'))
elseif g:go_fmt_fail_silently == 0
let errors = s:parse_errors(out)
let errors = s:parse_errors(expand('%'), out)
call s:show_errors(errors)
endif

Expand Down Expand Up @@ -196,7 +196,7 @@ function! s:fmt_cmd(bin_name, source, target)
endfunction

" parse_errors parses the given errors and returns a list of parsed errors
function! s:parse_errors(content) abort
function! s:parse_errors(filename, content) abort
let splitted = split(a:content, '\n')

" list of errors to be put into location list
Expand All @@ -205,6 +205,7 @@ function! s:parse_errors(content) abort
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)')
if !empty(tokens)
call add(errors,{
\"filename": a:filename,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[4],
Expand Down