aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2017-11-17 17:52:51 -0500
committerJustin M. Keyes <justinkz@gmail.com>2017-11-17 23:52:51 +0100
commite8af34dc635981367ba3b1da93b51e6984ef6111 (patch)
treedf6e016c68e5f68b3e9b07623517c358382140ba
parent07931ed1c8cc749222a513cba5bdf300067646bc (diff)
downloadrneovim-e8af34dc635981367ba3b1da93b51e6984ef6111.tar.gz
rneovim-e8af34dc635981367ba3b1da93b51e6984ef6111.tar.bz2
rneovim-e8af34dc635981367ba3b1da93b51e6984ef6111.zip
win: provider: Detect(): return *.cmd path (#7577)
neovim-ruby-host is a ruby script. neovim-node-host is a shell script. Both don't work in cmd.exe so gem and npm provide batchfile shims. Return the full path of these shims, cmd.exe knows better what to do with these files.
-rw-r--r--runtime/autoload/provider/node.vim16
-rw-r--r--runtime/autoload/provider/ruby.vim2
2 files changed, 11 insertions, 7 deletions
diff --git a/runtime/autoload/provider/node.vim b/runtime/autoload/provider/node.vim
index ce2740e813..b08ad4f316 100644
--- a/runtime/autoload/provider/node.vim
+++ b/runtime/autoload/provider/node.vim
@@ -6,7 +6,7 @@ let g:loaded_node_provider = 1
let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')}
function! provider#node#Detect() abort
- return exepath('neovim-node-host')
+ return has('win32') ? exepath('neovim-node-host.cmd') : exepath('neovim-node-host')
endfunction
function! provider#node#Prog()
@@ -19,13 +19,17 @@ function! provider#node#Require(host) abort
return
endif
- let args = ['node']
+ if has('win32')
+ let args = provider#node#Prog()
+ else
+ let args = ['node']
- if !empty($NVIM_NODE_HOST_DEBUG)
- call add(args, '--inspect-brk')
- endif
+ if !empty($NVIM_NODE_HOST_DEBUG)
+ call add(args, '--inspect-brk')
+ endif
- call add(args , provider#node#Prog())
+ call add(args , provider#node#Prog())
+ endif
try
let channel_id = jobstart(args, s:job_opts)
diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim
index 7df3500267..518a9dc793 100644
--- a/runtime/autoload/provider/ruby.vim
+++ b/runtime/autoload/provider/ruby.vim
@@ -19,7 +19,7 @@ function! provider#ruby#Detect() abort
if exists("g:ruby_host_prog")
return g:ruby_host_prog
else
- return exepath('neovim-ruby-host')
+ return has('win32') ? exepath('neovim-ruby-host.cmd') : exepath('neovim-ruby-host')
end
endfunction