Skip to content

Commit

Permalink
prefer '!= 0' to ! (#10) thanks to @bsamorodov
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Jul 14, 2018
1 parent 71c97b1 commit 700456e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion autoload/quickrun/runner/wandbox.vim
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function! s:polling_response(key)
let exit_status = 0
for [compiler, request] in items(filter(copy(session._work), 's:Prelude.is_dict(v:val) && has_key(v:val, "_exit_status")'))
let response = request.callback(request.files)
if ! response.success
if response.success != 0
call s:abort(session, 'Request has failed while executing '.compiler.'!: Status '. response.status . ': ' . response.statusText)
endif
let json_response = s:JSON.decode(response.content)
Expand Down
8 changes: 4 additions & 4 deletions autoload/wandbox.vim
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ function! s:prepare_to_output(work)
let s:async_compile_info = {'file' : expand('%:p'), 'bufnr' : a:work._bufnr}
for [compiler, request] in items(filter(copy(a:work), 's:Prelude.is_dict(v:val) && has_key(v:val, "_exit_status")'))
let response = request.callback(request.files)
if ! response.success
if response.success != 0
call s:abort('Request has failed while executing '.compiler.'!: Status '. response.status . ': ' . response.statusText)
endif
let s:async_compile_outputs = get(s:, 'async_compile_outputs', [])
call add(s:async_compile_outputs, [compiler, s:JSON.decode(response.content)])
endfor
elseif a:work._tag ==# 'list'
let response = a:work._list.callback(a:work._list.files)
if ! response.success
if response.success != 0
call s:abort('Request has failed! Status while getting option list!: '. response.status . ': ' . response.statusText)
endif
let s:async_list_outputs = get(s:, 'async_list_outputs', [])
Expand Down Expand Up @@ -420,7 +420,7 @@ function! wandbox#compile(code, compiler, options, runtime_options, stdin)
\ 'method' : 'POST',
\ 'client' : (g:wandbox#disable_python_client ? ['curl', 'wget'] : ['python', 'curl', 'wget']),
\ })
if ! response.success
if response.success != 0
throw "Request has failed! Status " . response.status . ': ' . response.statusText
endif
return s:JSON.decode(response.content)
Expand Down Expand Up @@ -490,7 +490,7 @@ function! wandbox#list()
\ 'url' : 'http://melpon.org/wandbox/api/list.json',
\ 'client' : (g:wandbox#disable_python_client ? ['curl', 'wget'] : ['python', 'curl', 'wget']),
\ })
if ! response.success
if response.success != 0
throw "Request has failed! Status " . response.status . ': ' . response.statusText
endif
return wandbox#prettyprint#pp(s:JSON.decode(response.content))
Expand Down

0 comments on commit 700456e

Please sign in to comment.