mirror of
https://github.com/amix/vimrc
synced 2025-06-24 07:44:59 +08:00
Updated plugins
This commit is contained in:
@ -30,6 +30,7 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
if !exists('s:go_new')
|
||||
let s:go_new = syntastic#util#versionIsAtLeast(self.getVersion(self.getExecEscaped() . ' version'), [1, 5])
|
||||
endif
|
||||
let buf = bufnr('')
|
||||
|
||||
" Check with gofmt first, since `go build` and `go test` might not report
|
||||
" syntax errors in the current file if another file with syntax error is
|
||||
@ -53,14 +54,14 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
|
||||
" Test files, i.e. files with a name ending in `_test.go`, are not
|
||||
" compiled by `go build`, therefore `go test` must be called for those.
|
||||
if match(expand('%', 1), '\m_test\.go$') == -1
|
||||
let cmd = 'build'
|
||||
let opts = syntastic#util#var('go_go_build_args', s:go_new ? '-buildmode=archive' : '')
|
||||
let cleanup = 0
|
||||
else
|
||||
if bufname(buf) =~# '\m_test\.go$'
|
||||
let cmd = 'test -c'
|
||||
let opts = syntastic#util#var('go_go_test_args', s:go_new ? '-buildmode=archive' : '')
|
||||
let opts = syntastic#util#bufVar(buf, 'go_go_test_args', s:go_new ? '-buildmode=archive' : '')
|
||||
let cleanup = 1
|
||||
else
|
||||
let cmd = 'build'
|
||||
let opts = syntastic#util#bufVar(buf, 'go_go_build_args', s:go_new ? '-buildmode=archive' : '')
|
||||
let cleanup = 0
|
||||
endif
|
||||
let opt_str = (type(opts) != type('') || opts !=# '') ? join(syntastic#util#argsescape(opts)) : opts
|
||||
let makeprg = self.getExecEscaped() . ' ' . cmd . ' ' . opt_str
|
||||
@ -82,12 +83,12 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
let errors = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'cwd': fnamemodify(bufname(buf), ':p:h'),
|
||||
\ 'env': {'GOGC': 'off'},
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
|
||||
if cleanup
|
||||
call delete(expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:p:h:t', 1) . '.test')
|
||||
call delete(fnamemodify(bufname(buf), ':p:h') . syntastic#util#Slash() . fnamemodify(bufname(buf), ':p:h') . '.test')
|
||||
endif
|
||||
|
||||
return errors
|
||||
|
@ -19,9 +19,10 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_gometalinter_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '-t',
|
||||
\ 'fname': syntastic#util#shexpand('%:p:h') })
|
||||
\ 'fname': syntastic#util#shescape(fnamemodify(bufname(buf), ':p:h')) })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l:%c:%trror: %m,' .
|
||||
|
@ -19,8 +19,9 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_gotype_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': (expand('%', 1) =~# '\m_test\.go$' ? '-a' : ''),
|
||||
\ 'args': (bufname(buf) =~# '\m_test\.go$' ? '-a' : ''),
|
||||
\ 'fname': '.' })
|
||||
|
||||
let errorformat =
|
||||
@ -34,7 +35,7 @@ function! SyntaxCheckers_go_gotype_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'cwd': fnamemodify(bufname(buf), ':p:h'),
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
endfunction
|
||||
|
||||
|
@ -19,6 +19,7 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_govet_GetLocList() dict
|
||||
let buf = bufnr('')
|
||||
let makeprg = self.getExecEscaped() . ' vet'
|
||||
|
||||
let errorformat =
|
||||
@ -33,7 +34,7 @@ function! SyntaxCheckers_go_govet_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h', 1),
|
||||
\ 'cwd': fnamemodify(bufname(buf), ':p:h'),
|
||||
\ 'defaults': {'type': 'w'} })
|
||||
endfunction
|
||||
|
||||
|
Reference in New Issue
Block a user