good exceptions

This commit is contained in:
David Halter
2013-08-24 01:30:35 +04:30
parent b5b31aa0e6
commit d9d5a329f0
2 changed files with 66 additions and 8 deletions

View File

@@ -155,6 +155,24 @@ function! jedi#configure_call_signatures()
autocmd CursorMovedI <buffer> call jedi#show_call_signatures_func()
endfunction
" Helper function instead of `python vim.eval()`, and `.command()` because
" these also return error definitions.
function! jedi#_vim_exceptions(str, is_eval)
let l:result = {}
try
if a:is_eval
let l:result.result = eval(a:str)
else
execute a:str
let l:result.result = ''
endif
catch
let l:result.exception = v:exception
let l:result.throwpoint = v:throwpoint
endtry
return l:result
endfunction
if has('python')
command! -nargs=1 Python python <args>
else