e23365bca9
Add s:suite.g_repl_filetype_repl_is_valid()
22 lines
739 B
VimL
22 lines
739 B
VimL
scriptencoding utf-8
|
|
|
|
function! repl#haskell#open_repl() abort
|
|
" Setting up the file for the current file
|
|
if &modified
|
|
" Create new file temporary
|
|
let l:module_file = tempname() . '.hs'
|
|
call writefile(getline(1, expand('$')), l:module_file)
|
|
else
|
|
let l:module_file = expand('%:p')
|
|
endif
|
|
|
|
let l:repl = repl#get_filetype_repl('haskell')
|
|
if !executable(l:repl['repl'])
|
|
call repl#echo_error(printf("You don't have repl: '%s'", l:repl['repl']))
|
|
return
|
|
endif
|
|
let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file)
|
|
let l:vimshell_interactive = ':VimShellInteractive' . printf("--split='%s'", g:repl_split_command)
|
|
execute l:vimshell_interactive l:args
|
|
endfunction
|