1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

Updated plugins

This commit is contained in:
Amir Salihefendic
2018-06-14 12:31:12 +02:00
parent 7288aee801
commit 3e3297af67
273 changed files with 11821 additions and 5377 deletions

View File

@ -1,6 +1,17 @@
function! go#cmd#autowrite() abort
if &autowrite == 1 || &autowriteall == 1
silent! wall
else
for l:nr in range(0, bufnr('$'))
if buflisted(l:nr) && getbufvar(l:nr, '&modified')
" Sleep one second to make sure people see the message. Otherwise it is
" often immediacy overwritten by the async messages (which also don't
" invoke the "hit ENTER" prompt).
call go#util#EchoWarning('[No write since last change]')
sleep 1
return
endif
endfor
endif
endfunction
@ -14,14 +25,14 @@ function! go#cmd#Build(bang, ...) abort
" placeholder with the current folder (indicated with '.'). We also pass -i
" that tries to install the dependencies, this has the side effect that it
" caches the build results, so every other build is faster.
let args =
\ ["build"] +
let l:args =
\ ['build', '-tags', go#config#BuildTags()] +
\ map(copy(a:000), "expand(v:val)") +
\ [".", "errors"]
" Vim async.
if go#util#has_job()
if get(g:, 'go_echo_command_info', 1)
if go#config#EchoCommandInfo()
call go#util#EchoProgress("building dispatched ...")
endif
@ -33,7 +44,7 @@ function! go#cmd#Build(bang, ...) abort
" Nvim async.
elseif has('nvim')
if get(g:, 'go_echo_command_info', 1)
if go#config#EchoCommandInfo()
call go#util#EchoProgress("building dispatched ...")
endif
@ -77,21 +88,26 @@ endfunction
" BuildTags sets or shows the current build tags used for tools
function! go#cmd#BuildTags(bang, ...) abort
if a:0
if a:0 == 1 && a:1 == '""'
unlet g:go_build_tags
let v = a:1
if v == '""' || v == "''"
let v = ""
endif
call go#config#SetBuildTags(v)
let tags = go#config#BuildTags()
if empty(tags)
call go#util#EchoSuccess("build tags are cleared")
else
let g:go_build_tags = a:1
call go#util#EchoSuccess("build tags are changed to: ". a:1)
call go#util#EchoSuccess("build tags are changed to: " . tags)
endif
return
endif
if !exists('g:go_build_tags')
let tags = go#config#BuildTags()
if empty(tags)
call go#util#EchoSuccess("build tags are not set")
else
call go#util#EchoSuccess("current build tags: ". g:go_build_tags)
call go#util#EchoSuccess("current build tags: " . tags)
endif
endfunction
@ -170,12 +186,12 @@ function! go#cmd#Install(bang, ...) abort
" expand all wildcards(i.e: '%' to the current file name)
let goargs = map(copy(a:000), "expand(v:val)")
if get(g:, 'go_echo_command_info', 1)
if go#config#EchoCommandInfo()
call go#util#EchoProgress("installing dispatched ...")
endif
call s:cmd_job({
\ 'cmd': ['go', 'install'] + goargs,
\ 'cmd': ['go', 'install', '-tags', go#config#BuildTags()] + goargs,
\ 'bang': a:bang,
\ 'for': 'GoInstall',
\})