Fix executable status detection

This commit is contained in:
aiya000 2016-01-03 02:18:36 +09:00
parent 1a3e11664b
commit 8dec444fe9
4 changed files with 16 additions and 12 deletions

View File

@ -39,9 +39,10 @@ function! repl#erlang#open_repl() abort
cd %:p:h cd %:p:h
endif endif
let l:repl = repl#get_filetype_repl('erlang') let l:repl = repl#get_filetype_repl('erlang')
if !executable(l:repl['repl']) let l:exec_name = split(l:repl['repl'], ' ')[0]
call repl#echo_error(printf("You don't have repl: '%s'", l:repl['repl'])) if !executable(l:exec_name)
call repl#echo_error(printf("You don't have repl: '%s'", l:exec_name))
return return
endif endif
let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file) let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file)

View File

@ -10,9 +10,10 @@ function! repl#haskell#open_repl() abort
let l:module_file = expand('%:p') let l:module_file = expand('%:p')
endif endif
let l:repl = repl#get_filetype_repl('haskell') let l:repl = repl#get_filetype_repl('haskell')
if !executable(l:repl['repl']) let l:exec_name = split(l:repl['repl'], ' ')[0]
call repl#echo_error(printf("You don't have repl: '%s'", l:repl['repl'])) if !executable(l:exec_name)
call repl#echo_error(printf("You don't have repl: '%s'", l:exec_name))
return return
endif endif
let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file) let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file)

View File

@ -10,9 +10,10 @@ function! repl#python#open_repl() abort
let l:module_file = expand('%:p') let l:module_file = expand('%:p')
endif endif
let l:repl = repl#get_filetype_repl('python') let l:repl = repl#get_filetype_repl('python')
if !executable(l:repl['repl']) let l:exec_name = split(l:repl['repl'], ' ')[0]
call repl#echo_error(printf("You don't have repl: '%s'", l:repl['repl'])) if !executable(l:exec_name)
call repl#echo_error(printf("You don't have repl: '%s'", l:exec_name))
return return
endif endif
let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file) let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file)

View File

@ -9,9 +9,10 @@ function! repl#ruby#open_repl() abort
let l:module_file = expand('%:p') let l:module_file = expand('%:p')
endif endif
let l:repl = repl#get_filetype_repl('ruby') let l:repl = repl#get_filetype_repl('ruby')
if !executable(l:repl['repl']) let l:exec_name = split(l:repl['repl'], ' ')[0]
call repl#echo_error(printf("You don't have repl: '%s'", l:repl['repl'])) if !executable(l:exec_name)
call repl#echo_error(printf("You don't have repl: '%s'", l:exec_name))
return return
endif endif
let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file) let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file)