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

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

View File

@ -11,8 +11,9 @@ function! repl#haskell#open_repl() abort
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']))
let l:exec_name = split(l:repl['repl'], ' ')[0]
if !executable(l:exec_name)
call repl#echo_error(printf("You don't have repl: '%s'", l:exec_name))
return
endif
let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file)

View File

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

View File

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