Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two quick fixes so the plugin works properly (was error-ing previously) #1

Merged
merged 2 commits into from
Jul 23, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ftplugin/go/playground.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ endfunction

function! s:playground(bang)
if !executable('curl')
echoerr "install curl command"
echoerr "install curl command"
return
endif
echon 'Compiling and running...'
if a:bang =~ '^!'
let res = http#post('http://play.golang.org/share', join(getline(1, line('$')), "\n"))
let res = webapi#http#post('http://play.golang.org/share', join(getline(1, line('$')), "\n"))
let url = printf('http://play.golang.org/p/%s', res.content)
echo url
let browser = get(g:, 'goplayground_open_browser', '')
Expand All @@ -28,8 +28,8 @@ function! s:playground(bang)
let @+ = url
endif
else
let res = http#post('http://play.golang.org/compile', {"body": join(getline(1, line('$')), "\n")})
let obj = json#decode(res.content)
let res = webapi#http#post('http://play.golang.org/compile', {"body": join(getline(1, line('$')), "\n")})
let obj = webapi#json#decode(res.content)
if has_key(obj, 'compile_errors') && len(obj.compile_errors)
echohl WarningMsg | echo obj.compile_errors | echohl None
elseif has_key(obj, 'output')
Expand Down