Skip to content

Commit

Permalink
do not change to list window when bang is set
Browse files Browse the repository at this point in the history
  • Loading branch information
bhcleek committed Mar 29, 2019
1 parent 17d4c08 commit 9b4e2bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion autoload/go/job.vim
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ function! go#job#Options(args)
" the job was started.
if self.winid == l:winid
call go#list#Window(l:listtype, len(errors))
if !self.bang
if self.bang
call win_gotoid(l:winid)
else
call go#list#JumpToFirst(l:listtype)
endif
endif
Expand Down
15 changes: 13 additions & 2 deletions autoload/go/lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,18 @@ function! go#lint#Golint(bang, ...) abort
return
endif

let l:winid = win_getid(winnr())
let l:listtype = go#list#Type("GoLint")
call go#list#Parse(l:listtype, l:out, "GoLint")
let l:errors = go#list#Get(l:listtype)
call go#list#Window(l:listtype, len(l:errors))
if !a:bang
call go#list#JumpToFirst(l:listtype)

if a:bang
call win_gotoid(l:winid)
return
endif

call go#list#JumpToFirst(l:listtype)
endfunction

" Vet calls 'go vet' on the current directory. Any warnings are populated in
Expand All @@ -138,12 +143,15 @@ function! go#lint#Vet(bang, ...) abort

let l:listtype = go#list#Type("GoVet")
if l:err != 0
let l:winid = win_getid(winnr())
let errorformat = "%-Gexit status %\\d%\\+," . &errorformat
call go#list#ParseFormat(l:listtype, l:errorformat, out, "GoVet")
let errors = go#list#Get(l:listtype)
call go#list#Window(l:listtype, len(errors))
if !empty(errors) && !a:bang
call go#list#JumpToFirst(l:listtype)
else
call win_gotoid(l:winid)
endif
else
call go#list#Clean(l:listtype)
Expand Down Expand Up @@ -171,6 +179,7 @@ function! go#lint#Errcheck(bang, ...) abort

let l:listtype = go#list#Type("GoErrCheck")
if l:err != 0
let l:winid = win_getid(winnr())
let errformat = "%f:%l:%c:\ %m, %f:%l:%c\ %#%m"

" Parse and populate our location list
Expand All @@ -187,6 +196,8 @@ function! go#lint#Errcheck(bang, ...) abort
call go#list#Window(l:listtype, len(errors))
if !a:bang
call go#list#JumpToFirst(l:listtype)
else
call win_gotoid(l:winid)
endif
endif
else
Expand Down

0 comments on commit 9b4e2bf

Please sign in to comment.