So many missing aborts

This commit is contained in:
Tim Pope 2014-01-06 22:58:43 -05:00
parent 4ce1f8fbfa
commit 9664516d5f
2 changed files with 20 additions and 20 deletions

View File

@ -189,7 +189,7 @@ function! s:nrepl_eval(expr, ...) dict abort
return response return response
endfunction endfunction
function! s:extract_last_stacktrace(nrepl) function! s:extract_last_stacktrace(nrepl) abort
let format_st = '(clojure.core/symbol (clojure.core/str "\n\b" (clojure.core/apply clojure.core/str (clojure.core/interleave (clojure.core/repeat "\n") (clojure.core/map clojure.core/str (.getStackTrace *e)))) "\n\b\n"))' let format_st = '(clojure.core/symbol (clojure.core/str "\n\b" (clojure.core/apply clojure.core/str (clojure.core/interleave (clojure.core/repeat "\n") (clojure.core/map clojure.core/str (.getStackTrace *e)))) "\n\b\n"))'
let stacktrace = split(get(split(a:nrepl.process({'op': 'eval', 'code': '['.format_st.' *3 *2 *1]', 'session': a:nrepl.session}).value[0], "\n\b\n"), 1, ""), "\n") let stacktrace = split(get(split(a:nrepl.process({'op': 'eval', 'code': '['.format_st.' *3 *2 *1]', 'session': a:nrepl.session}).value[0], "\n\b\n"), 1, ""), "\n")
call a:nrepl.call({'op': 'eval', 'code': '(nth *1 1)', 'session': a:nrepl.session}) call a:nrepl.call({'op': 'eval', 'code': '(nth *1 1)', 'session': a:nrepl.session})

View File

@ -16,11 +16,11 @@ augroup END
" }}}1 " }}}1
" Escaping {{{1 " Escaping {{{1
function! s:str(string) function! s:str(string) abort
return '"' . escape(a:string, '"\') . '"' return '"' . escape(a:string, '"\') . '"'
endfunction endfunction
function! s:qsym(symbol) function! s:qsym(symbol) abort
if a:symbol =~# '^[[:alnum:]?*!+/=<>.:-]\+$' if a:symbol =~# '^[[:alnum:]?*!+/=<>.:-]\+$'
return "'".a:symbol return "'".a:symbol
else else
@ -163,7 +163,7 @@ function! s:repl.includes_file(file) dict abort
endfor endfor
endfunction endfunction
function! s:register_connection(conn, ...) function! s:register_connection(conn, ...) abort
call insert(s:repls, extend({'connection': a:conn}, deepcopy(s:repl))) call insert(s:repls, extend({'connection': a:conn}, deepcopy(s:repl)))
if a:0 && a:1 !=# '' if a:0 && a:1 !=# ''
let s:repl_paths[a:1] = s:repls[0] let s:repl_paths[a:1] = s:repls[0]
@ -176,7 +176,7 @@ endfunction
command! -bar -complete=customlist,s:connect_complete -nargs=* FireplaceConnect :exe s:Connect(<f-args>) command! -bar -complete=customlist,s:connect_complete -nargs=* FireplaceConnect :exe s:Connect(<f-args>)
function! fireplace#input_host_port() function! fireplace#input_host_port() abort
let arg = input('Host> ', 'localhost') let arg = input('Host> ', 'localhost')
if arg ==# '' if arg ==# ''
return '' return ''
@ -190,11 +190,11 @@ function! fireplace#input_host_port()
return arg return arg
endfunction endfunction
function! s:protos() function! s:protos() abort
return map(split(globpath(&runtimepath, 'autoload/*/fireplace_connection.vim'), "\n"), 'fnamemodify(v:val, ":h:t")') return map(split(globpath(&runtimepath, 'autoload/*/fireplace_connection.vim'), "\n"), 'fnamemodify(v:val, ":h:t")')
endfunction endfunction
function! s:connect_complete(A, L, P) function! s:connect_complete(A, L, P) abort
let proto = matchstr(a:A, '\w\+\ze://') let proto = matchstr(a:A, '\w\+\ze://')
if proto ==# '' if proto ==# ''
let options = map(s:protos(), 'v:val."://"') let options = map(s:protos(), 'v:val."://"')
@ -213,7 +213,7 @@ function! s:connect_complete(A, L, P)
return options return options
endfunction endfunction
function! s:Connect(...) function! s:Connect(...) abort
if (a:0 ? a:1 : '') =~# '^\w\+://' if (a:0 ? a:1 : '') =~# '^\w\+://'
let [proto, arg] = split(a:1, '://') let [proto, arg] = split(a:1, '://')
elseif a:0 elseif a:0
@ -315,7 +315,7 @@ function! s:oneoff.eval(expr, options) dict abort
endif endif
endfunction endfunction
function! s:oneoff.require(symbol) function! s:oneoff.require(symbol) abort
return '' return ''
endfunction endfunction
@ -347,7 +347,7 @@ function! fireplace#client() abort
return s:client() return s:client()
endfunction endfunction
function! fireplace#local_client(...) function! fireplace#local_client(...) abort
if !a:0 if !a:0
silent doautocmd User FireplacePreConnect silent doautocmd User FireplacePreConnect
endif endif
@ -700,7 +700,7 @@ endfunction
" line window and tries to switch out of it (such as with ctrl-w), Vim will " line window and tries to switch out of it (such as with ctrl-w), Vim will
" crash when the command line window closes. Adding an indirect function call " crash when the command line window closes. Adding an indirect function call
" works around this. " works around this.
function! s:actually_input(...) function! s:actually_input(...) abort
return call(function('input'), a:000) return call(function('input'), a:000)
endfunction endfunction
@ -834,16 +834,16 @@ function! s:setup_eval() abort
map! <buffer> <C-R>( <Plug>FireplaceRecall map! <buffer> <C-R>( <Plug>FireplaceRecall
endfunction endfunction
function! s:setup_historical() function! s:setup_historical() abort
setlocal readonly nomodifiable setlocal readonly nomodifiable
nnoremap <buffer><silent>q :bdelete<CR> nnoremap <buffer><silent>q :bdelete<CR>
endfunction endfunction
function! s:cmdwinenter() function! s:cmdwinenter() abort
setlocal filetype=clojure setlocal filetype=clojure
endfunction endfunction
function! s:cmdwinleave() function! s:cmdwinleave() abort
setlocal filetype< omnifunc< setlocal filetype< omnifunc<
endfunction endfunction
@ -860,7 +860,7 @@ augroup END
" }}}1 " }}}1
" :Require {{{1 " :Require {{{1
function! s:Require(bang, ns) function! s:Require(bang, ns) abort
let cmd = ('(clojure.core/require '.s:qsym(a:ns ==# '' ? fireplace#ns() : a:ns).' :reload'.(a:bang ? '-all' : '').')') let cmd = ('(clojure.core/require '.s:qsym(a:ns ==# '' ? fireplace#ns() : a:ns).' :reload'.(a:bang ? '-all' : '').')')
echo cmd echo cmd
try try
@ -871,7 +871,7 @@ function! s:Require(bang, ns)
endtry endtry
endfunction endfunction
function! s:setup_require() function! s:setup_require() abort
command! -buffer -bar -bang -complete=customlist,fireplace#ns_complete -nargs=? Require :exe s:Require(<bang>0, <q-args>) command! -buffer -bar -bang -complete=customlist,fireplace#ns_complete -nargs=? Require :exe s:Require(<bang>0, <q-args>)
nnoremap <silent><buffer> cpr :Require<CR> nnoremap <silent><buffer> cpr :Require<CR>
endfunction endfunction
@ -1079,7 +1079,7 @@ function! s:Lookup(ns, macro, arg) abort
return '' return ''
endfunction endfunction
function! s:inputlist(label, entries) function! s:inputlist(label, entries) abort
let choices = [a:label] let choices = [a:label]
for i in range(len(a:entries)) for i in range(len(a:entries))
let choices += [printf('%2d. %s', i+1, a:entries[i])] let choices += [printf('%2d. %s', i+1, a:entries[i])]
@ -1112,7 +1112,7 @@ function! s:Apropos(pattern) abort
endif endif
endfunction endfunction
function! s:K() function! s:K() abort
let word = expand('<cword>') let word = expand('<cword>')
let java_candidate = matchstr(word, '^\%(\w\+\.\)*\u\l\w*\ze\%(\.\|\/\w\+\)\=$') let java_candidate = matchstr(word, '^\%(\w\+\.\)*\u\l\w*\ze\%(\.\|\/\w\+\)\=$')
if java_candidate !=# '' if java_candidate !=# ''
@ -1196,7 +1196,7 @@ if !exists('s:leiningen_repl_ports')
let s:leiningen_repl_ports = {} let s:leiningen_repl_ports = {}
endif endif
function! s:portfile() function! s:portfile() abort
if !exists('b:leiningen_root') if !exists('b:leiningen_root')
return '' return ''
endif endif
@ -1213,7 +1213,7 @@ function! s:portfile()
endfunction endfunction
function! s:leiningen_connect() function! s:leiningen_connect() abort
let portfile = s:portfile() let portfile = s:portfile()
if empty(portfile) if empty(portfile)
return return