Skip to content

Commit

Permalink
rebase master
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Apr 26, 2016
1 parent 7cb83dd commit 668f58a
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions autoload/ctrlp/decls.vim
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ function! ctrlp#decls#enter()
let command .= printf(" -dir %s", dir)
endif

let out = go#util#system(command)
if go#util#shell_error() != 0
let out = go#util#System(command)
if go#util#ShellError() != 0
call go#util#EchoError(out)
return
endif
Expand Down
4 changes: 2 additions & 2 deletions autoload/go/asmfmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ function! go#asmfmt#Format()
if empty(path)
return
endif
let out = go#util#system(path . ' -w ' . l:tmpname)
let out = go#util#System(path . ' -w ' . l:tmpname)

" If there's no error, replace the current file with the output.
if go#util#shell_error() != 0
if go#util#ShellError() != 0
" Remove undo point caused by BufWritePre.
try | silent undojoin | catch | endtry

Expand Down
4 changes: 2 additions & 2 deletions autoload/go/cmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function! go#cmd#Test(bang, compile, ...)

let l:listtype = "quickfix"

if go#util#shell_error() != 0
if go#util#ShellError() != 0
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
let dir = getcwd()
try
Expand Down Expand Up @@ -299,7 +299,7 @@ function! go#cmd#Generate(bang, ...)

" :make expands '%' and '#' wildcards, so they must also be escaped
let goargs = go#util#Shelljoin(map(copy(a:000), "expand(v:val)"), 1)
if go#util#shell_error() != 0
if go#util#ShellError() != 0
let &makeprg = "go generate " . goargs
else
let gofiles = go#util#Shelljoin(go#tool#Files(), 1)
Expand Down
4 changes: 2 additions & 2 deletions autoload/go/complete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ fu! s:gocodeCommand(cmd, preargs, args)
let old_gopath = $GOPATH
let $GOPATH = go#path#Detect()

let result = go#util#system(printf('%s %s %s %s', go#util#Shellescape(bin_path), join(a:preargs), go#util#Shellescape(a:cmd), join(a:args)))
let result = go#util#System(printf('%s %s %s %s', go#util#Shellescape(bin_path), join(a:preargs), go#util#Shellescape(a:cmd), join(a:args)))

let $GOPATH = old_gopath

if go#util#shell_error() != 0
if go#util#ShellError() != 0
return "[\"0\", []]"
else
if &encoding != 'utf-8'
Expand Down
4 changes: 2 additions & 2 deletions autoload/go/coverage.vim
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function! go#coverage#Buffer(bang, ...)
return
endif

if go#util#shell_error() != 0
if go#util#ShellError() != 0
call go#coverage#overlay(l:tmpname)
endif

Expand Down Expand Up @@ -90,7 +90,7 @@ function! go#coverage#Browser(bang, ...)
let s:coverage_browser_handler_jobs[id] = l:tmpname
return
endif
if go#util#shell_error() != 0
if go#util#ShellError() != 0
let openHTML = 'go tool cover -html='.l:tmpname
call go#tool#ExecuteInDir(openHTML)
endif
Expand Down
4 changes: 2 additions & 2 deletions autoload/go/def.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function! go#def#Jump(mode)
let fname = fnamemodify(expand("%"), ':p:gs?\\?/?')
let command = printf("%s definition %s:#%s", bin_path, shellescape(fname), go#util#OffsetCursor())

let out = go#util#system(command)
if go#util#shell_error() != 0
let out = go#util#System(command)
if go#util#ShellError() != 0
call go#util#EchoError(out)
return
endif
Expand Down
4 changes: 2 additions & 2 deletions autoload/go/doc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ function! go#doc#Open(newmode, mode, ...)

let command = printf("%s -pos %s:#%s", bin_path, fname, offset)

let out = go#util#system(command)
if go#util#shell_error() != 0
let out = go#util#System(command)
if go#util#ShellError() != 0
call go#util#EchoError(out)
return
endif
Expand Down
6 changes: 3 additions & 3 deletions autoload/go/fmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function! go#fmt#Format(withGoimport)

if fmt_command == "goimports"
if !exists('b:goimports_vendor_compatible')
let out = go#util#system("goimports --help")
let out = go#util#System("goimports --help")
if out !~ "-srcdir"
echohl WarningMsg
echomsg "vim-go: goimports does not support srcdir."
Expand All @@ -138,7 +138,7 @@ function! go#fmt#Format(withGoimport)
if go#util#IsWin()
let l:tmpname = tr(l:tmpname, '\', '/')
endif
let out = go#util#system(command . " " . l:tmpname)
let out = go#util#System(command . " " . l:tmpname)

if fmt_command != "gofmt"
let $GOPATH = old_gopath
Expand All @@ -148,7 +148,7 @@ function! go#fmt#Format(withGoimport)
"if there is no error on the temp file replace the output with the current
"file (if this fails, we can always check the outputs first line with:
"splitted =~ 'package \w\+')
if go#util#shell_error() == 0
if go#util#ShellError() == 0
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry

Expand Down
4 changes: 2 additions & 2 deletions autoload/go/guru.vim
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ func! s:RunGuru(mode, format, selected, needs_scope) range abort
call go#util#EchoProgress("analysing ...")

" run, forrest run!!!
let out = go#util#system(command)
let out = go#util#System(command)

let $GOPATH = old_gopath

if go#util#shell_error() != 0
if go#util#ShellError() != 0
" unfortunaly guru outputs a very long stack trace that is not
" parsable to show the real error. But the main issue is usually the
" package which doesn't build.
Expand Down
4 changes: 2 additions & 2 deletions autoload/go/import.vim
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function! go#import#SwitchImport(enabled, localname, path, bang)
endif

if a:bang == "!"
let out = go#util#system("go get -u -v ".shellescape(path))
if go#util#shell_error() != 0
let out = go#util#System("go get -u -v ".shellescape(path))
if go#util#ShellError() != 0
call s:Error("Can't find import: " . path . ":" . out)
endif
endif
Expand Down
8 changes: 4 additions & 4 deletions autoload/go/lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function! go#lint#Gometa(autosave, ...) abort
let out = go#tool#ExecuteInDir(meta_command)

let l:listtype = "quickfix"
if go#util#shell_error() != 0
if go#util#ShellError() != 0
redraw | echo
call go#list#Clean(l:listtype)
call go#list#Window(l:listtype)
Expand Down Expand Up @@ -102,7 +102,7 @@ function! go#lint#Golint(...) abort
let goargs = go#util#Shelljoin(a:000)
endif

let out = go#util#system(bin_path . " " . goargs)
let out = go#util#System(bin_path . " " . goargs)
if empty(out)
echon "vim-go: " | echohl Function | echon "[lint] PASS" | echohl None
return
Expand All @@ -127,7 +127,7 @@ function! go#lint#Vet(bang, ...)
endif

let l:listtype = "quickfix"
if go#util#shell_error() != 0
if go#util#ShellError() != 0
let errors = go#tool#ParseErrors(split(out, '\n'))
call go#list#Populate(l:listtype, errors)
call go#list#Window(l:listtype, len(errors))
Expand Down Expand Up @@ -167,7 +167,7 @@ function! go#lint#Errcheck(...) abort
let out = go#tool#ExecuteInDir(command)

let l:listtype = "quickfix"
if go#util#shell_error() != 0
if go#util#ShellError() != 0
let errformat = "%f:%l:%c:\ %m, %f:%l:%c\ %#%m"

" Parse and populate our location list
Expand Down
8 changes: 4 additions & 4 deletions autoload/go/package.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ function! go#package#Paths()

if !exists("s:goroot")
if executable('go')
let s:goroot = substitute(go#util#system('go env GOROOT'), '\n', '', 'g')
if go#util#shell_error() != 0
let s:goroot = substitute(go#util#System('go env GOROOT'), '\n', '', 'g')
if go#util#ShellError() != 0
echomsg '''go env GOROOT'' failed'
endif
else
Expand Down Expand Up @@ -95,8 +95,8 @@ function! go#package#FromPath(arg)
endfunction

function! go#package#CompleteMembers(package, member)
silent! let content = go#util#system('godoc ' . a:package)
if go#util#shell_error() || !len(content)
silent! let content = go#util#System('godoc ' . a:package)
if go#util#ShellError() || !len(content)
return []
endif
let lines = filter(split(content, "\n"),"v:val !~ '^\\s\\+$'")
Expand Down
6 changes: 3 additions & 3 deletions autoload/go/play.vim
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ function! go#play#Share(count, line1, line2)
call writefile(split(content, "\n"), share_file, "b")

let command = "curl -s -X POST http://play.golang.org/share --data-binary '@".share_file."'"
let snippet_id = go#util#system(command)
let snippet_id = go#util#System(command)

" we can remove the temp file because it's now posted.
call delete(share_file)

if go#util#shell_error() != 0
if go#util#ShellError() != 0
echo 'A error has occured. Run this command to see what the problem is:'
echo command
return
Expand Down Expand Up @@ -77,7 +77,7 @@ function! s:get_browser_command()
if go_play_browser_command == ''
if has('win32') || has('win64')
let go_play_browser_command = '!start rundll32 url.dll,FileProtocolHandler %URL%'
elseif has('mac') || has('macunix') || has('gui_macvim') || go#util#system('uname') =~? '^darwin'
elseif has('mac') || has('macunix') || has('gui_macvim') || go#util#System('uname') =~? '^darwin'
let go_play_browser_command = 'open %URL%'
elseif executable('xdg-open')
let go_play_browser_command = 'xdg-open %URL%'
Expand Down
2 changes: 1 addition & 1 deletion autoload/go/rename.vim
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function! go#rename#Rename(bang, ...)
let clean = split(out, '\n')

let l:listtype = "quickfix"
if go#util#shell_error() != 0
if go#util#ShellError() != 0
let errors = go#tool#ParseErrors(split(out, '\n'))
call go#list#Populate(l:listtype, errors)
call go#list#Window(l:listtype, len(errors))
Expand Down
8 changes: 4 additions & 4 deletions autoload/go/textobj.vim
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function! go#textobj#Function(mode)
let command .= " -parse-comments"
endif

let out = go#util#system(command)
if go#util#shell_error() != 0
let out = go#util#System(command)
if go#util#ShellError() != 0
call go#util#EchoError(out)
return
endif
Expand Down Expand Up @@ -129,8 +129,8 @@ function! go#textobj#FunctionJump(mode, direction)
let command .= " -parse-comments"
endif

let out = go#util#system(command)
if go#util#shell_error() != 0
let out = go#util#System(command)
if go#util#ShellError() != 0
call go#util#EchoError(out)
return
endif
Expand Down
10 changes: 5 additions & 5 deletions autoload/go/tool.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function! go#tool#Imports()
let command = "go list -f $'{{range $f := .Imports}}{{$f}}\n{{end}}'"
endif
let out = go#tool#ExecuteInDir(command)
if go#util#shell_error() != 0
if go#util#ShellError() != 0
echo out
return imports
endif
Expand Down Expand Up @@ -114,7 +114,7 @@ function! go#tool#ExecuteInDir(cmd) abort
let dir = getcwd()
try
execute cd . fnameescape(expand("%:p:h"))
let out = go#util#system(a:cmd)
let out = go#util#System(a:cmd)
finally
execute cd . fnameescape(dir)
endtry
Expand All @@ -129,7 +129,7 @@ function! go#tool#Exists(importpath)
let command = "go list ". a:importpath
let out = go#tool#ExecuteInDir(command)

if go#util#shell_error() != 0
if go#util#ShellError() != 0
return -1
endif

Expand All @@ -144,7 +144,7 @@ function! s:get_browser_command()
if go_play_browser_command == ''
if go#util#IsWin()
let go_play_browser_command = '!start rundll32 url.dll,FileProtocolHandler %URL%'
elseif has('mac') || has('macunix') || has('gui_macvim') || go#util#system('uname') =~? '^darwin'
elseif has('mac') || has('macunix') || has('gui_macvim') || go#util#System('uname') =~? '^darwin'
let go_play_browser_command = 'open %URL%'
elseif executable('xdg-open')
let go_play_browser_command = 'xdg-open %URL%'
Expand Down Expand Up @@ -175,7 +175,7 @@ function! go#tool#OpenBrowser(url)
exec cmd
else
let cmd = substitute(cmd, '%URL%', '\=shellescape(a:url)', 'g')
call go#util#system(cmd)
call go#util#System(cmd)
endif
endfunction

Expand Down
4 changes: 2 additions & 2 deletions autoload/go/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ else
let s:vim_shell_error = ''
endif

function! go#util#system(str, ...)
function! go#util#System(str, ...)
return call(s:vim_system, [a:str] + a:000)
endfunction

function! go#util#shell_error()
function! go#util#ShellError()
if empty(s:vim_shell_error)
return v:shell_error
endif
Expand Down
6 changes: 3 additions & 3 deletions plugin/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function! s:GoInstallBinaries(updateBinaries)

let cmd = "go get -u -v "

let s:go_version = matchstr(go#util#system("go version"), '\d.\d.\d')
let s:go_version = matchstr(go#util#System("go version"), '\d.\d.\d')

" https://github.com/golang/go/issues/10791
if s:go_version > "1.4.0" && s:go_version < "1.5.0"
Expand All @@ -91,8 +91,8 @@ function! s:GoInstallBinaries(updateBinaries)
endif


let out = go#util#system(cmd . shellescape(pkg))
if go#util#shell_error() != 0
let out = go#util#System(cmd . shellescape(pkg))
if go#util#ShellError() != 0
echo "Error installing ". pkg . ": " . out
endif
endif
Expand Down

0 comments on commit 668f58a

Please sign in to comment.