@@ 15,17 15,6 @@ if !executable('curl')
finish
endif
-if globpath(&rtp, 'autoload/webapi/http.vim') ==# ''
- echohl ErrorMsg
- echomsg 'srht.vim requires the ''webapi'' plugin, '
- echomsg 'visit https://github.com/mattn/webapi-vim to install it.'
- echohl None
- finish
-else
- " Make sure the webapi plugin works.
- call webapi#json#true()
-endif
-
" Configuration: paste
if !exists('g:srht_paste_default_visibility')
let g:srht_paste_default_visibility = 'unlisted'
@@ 197,6 186,18 @@ endfunction
function! srht#Paste(...) abort
redraw
+ " Ensure webapi plugin is installed
+ if globpath(&rtp, 'autoload/webapi/http.vim') ==# ''
+ echohl ErrorMsg
+ echomsg 'srht.vim requires the ''webapi'' plugin, '
+ echomsg 'visit https://github.com/mattn/webapi-vim to install it.'
+ echohl None
+ finish
+ else
+ " Make sure the webapi plugin works.
+ call webapi#json#true()
+ endif
+
let visibility = g:srht_paste_default_visibility
let paste_sha = ''