Abort for each functions

This commit is contained in:
ujihisa 2015-12-19 23:51:15 -08:00
parent 348a96fc7d
commit dd5619856f

View File

@ -5,7 +5,7 @@ set cpo&vim
"TODO: Branch python2 and python3 "TODO: Branch python2 and python3
"TODO: DRY "TODO: DRY
function! s:echo_error(msg) function! s:echo_error(msg) abort
echohl Error echohl Error
echomsg a:msg echomsg a:msg
echohl None echohl None
@ -17,7 +17,7 @@ endfunction
"#-=- -=- -=- -=- -=- -=- -=- -=- -=-#" "#-=- -=- -=- -=- -=- -=- -=- -=- -=-#"
function! repl#run_repl() function! repl#run_repl() abort
if &filetype ==# 'ruby' if &filetype ==# 'ruby'
call repl#start_ruby() call repl#start_ruby()
elseif &filetype ==# 'haskell' elseif &filetype ==# 'haskell'
@ -39,7 +39,7 @@ endfunction
"#-=- -=- -=- -=- -=- -=- -=- -=- -=-#" "#-=- -=- -=- -=- -=- -=- -=- -=- -=-#"
function! repl#start_ruby() function! repl#start_ruby() abort
" Setting up the obj file for the current file " Setting up the obj file for the current file
if &modified if &modified
let l:module_file = tempname() . '.rb' let l:module_file = tempname() . '.rb'
@ -60,7 +60,7 @@ function! repl#start_ruby()
execute ':VimShellInteractive' l:args execute ':VimShellInteractive' l:args
endfunction endfunction
function! repl#start_haskell() function! repl#start_haskell() abort
" Setting up the file for the current file " Setting up the file for the current file
if &modified if &modified
" Create new file temporary " Create new file temporary
@ -82,7 +82,7 @@ function! repl#start_haskell()
execute ':VimShellInteractive' l:args execute ':VimShellInteractive' l:args
endfunction endfunction
function! repl#start_python() function! repl#start_python() abort
" Setting up the file for the current file " Setting up the file for the current file
if &modified if &modified
" Create new file temporary " Create new file temporary
@ -105,7 +105,7 @@ function! repl#start_python()
endfunction endfunction
function! repl#start_erlang() function! repl#start_erlang() abort
" FIXME: this function messes current directly with a .bean file. " FIXME: this function messes current directly with a .bean file.
let l:pwd = getcwd() let l:pwd = getcwd()
@ -161,7 +161,7 @@ endfunction
"-------------------" "-------------------"
function! s:writefile_with_erlang_module(lines, filepath) function! s:writefile_with_erlang_module(lines, filepath) abort
let l:module_defined_line = match(a:lines, '-module') let l:module_defined_line = match(a:lines, '-module')
if l:module_defined_line is -1 if l:module_defined_line is -1
throw "REPL_VIM: repl.vim couldn't -module difinition !" throw "REPL_VIM: repl.vim couldn't -module difinition !"