mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -10,10 +10,6 @@ if !exists("g:go_metalinter_enabled")
|
||||
let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck']
|
||||
endif
|
||||
|
||||
if !exists("g:go_metalinter_deadline")
|
||||
let g:go_metalinter_deadline = "5s"
|
||||
endif
|
||||
|
||||
if !exists("g:go_golint_bin")
|
||||
let g:go_golint_bin = "golint"
|
||||
endif
|
||||
@ -48,16 +44,33 @@ function! go#lint#Gometa(autosave, ...) abort
|
||||
let cmd += [expand('%:p:h')]
|
||||
else
|
||||
" the user wants something else, let us use it.
|
||||
let cmd += [split(g:go_metalinter_command, " ")]
|
||||
let cmd += split(g:go_metalinter_command, " ")
|
||||
endif
|
||||
|
||||
" gometalinter has a default deadline of 5 seconds.
|
||||
"
|
||||
" For async mode (s:lint_job), we want to override the default deadline only
|
||||
" if we have a deadline configured.
|
||||
"
|
||||
" For sync mode (go#tool#ExecuteInDir), always explicitly pass the 5 seconds
|
||||
" deadline if there is no other deadline configured. If a deadline is
|
||||
" configured, then use it.
|
||||
|
||||
" Call gometalinter asynchronously.
|
||||
if go#util#has_job() && has('lambda')
|
||||
let deadline = get(g:, 'go_metalinter_deadline', 0)
|
||||
if deadline != 0
|
||||
let cmd += ["--deadline=" . deadline]
|
||||
endif
|
||||
|
||||
call s:lint_job({'cmd': cmd})
|
||||
return
|
||||
endif
|
||||
|
||||
" we add deadline only for sync mode
|
||||
let cmd += ["--deadline=" . g:go_metalinter_deadline]
|
||||
" We're calling gometalinter synchronously.
|
||||
|
||||
let cmd += ["--deadline=" . get(g:, 'go_metalinter_deadline', "5s")]
|
||||
|
||||
if a:autosave
|
||||
" include only messages for the active buffer
|
||||
let cmd += ["--include='^" . expand('%:p') . ".*$'"]
|
||||
@ -283,8 +296,8 @@ function s:lint_job(args)
|
||||
endfunction
|
||||
|
||||
let start_options = {
|
||||
\ 'callback': function("s:callback"),
|
||||
\ 'close_cb': function("s:close_cb"),
|
||||
\ 'callback': funcref("s:callback"),
|
||||
\ 'close_cb': funcref("s:close_cb"),
|
||||
\ }
|
||||
|
||||
call job_start(a:args.cmd, start_options)
|
||||
|
Reference in New Issue
Block a user