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

Updated vimrc

This commit is contained in:
amix
2015-07-13 11:22:46 +01:00
parent 9a2843c2a5
commit d7752b59ae
301 changed files with 4699 additions and 7969 deletions

View File

@ -31,6 +31,9 @@ fu! s:system(str, ...)
endf
fu! s:gocodeShellescape(arg)
if go#vimproc#has_vimproc()
return vimproc#shellescape(a:arg)
endif
try
let ssl_save = &shellslash
set noshellslash
@ -48,12 +51,20 @@ fu! s:gocodeCommand(cmd, preargs, args)
let a:preargs[i] = s:gocodeShellescape(a:preargs[i])
endfor
let bin_path = go#tool#BinPath(g:go_gocode_bin)
let bin_path = go#path#CheckBinPath(g:go_gocode_bin)
if empty(bin_path)
return
endif
let result = s:system(printf('%s %s %s %s', bin_path, join(a:preargs), a:cmd, join(a:args)))
" we might hit cache problems, as gocode doesn't handle well different
" GOPATHS: https://github.com/nsf/gocode/issues/239
let old_gopath = $GOPATH
let $GOPATH = go#path#Detect()
let result = s:system(printf('%s %s %s %s', s:gocodeShellescape(bin_path), join(a:preargs), s:gocodeShellescape(a:cmd), join(a:args)))
let $GOPATH = old_gopath
if v:shell_error != 0
return "[\"0\", []]"
else