aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/remote/host.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload/remote/host.vim')
-rw-r--r--runtime/autoload/remote/host.vim16
1 files changed, 9 insertions, 7 deletions
diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim
index 5a3097af5d..64f6ddb759 100644
--- a/runtime/autoload/remote/host.vim
+++ b/runtime/autoload/remote/host.vim
@@ -40,7 +40,11 @@ function! remote#host#Require(name)
endif
let host = s:hosts[a:name]
if !host.channel && !host.initialized
- let host.channel = call(host.factory, [a:name])
+ let host_info = {
+ \ 'name': a:name,
+ \ 'orig_name': get(host, 'orig_name', a:name)
+ \ }
+ let host.channel = call(host.factory, [host_info])
let host.initialized = 1
endif
return host.channel
@@ -77,7 +81,7 @@ function! remote#host#RegisterPlugin(host, path, specs)
endif
endfor
- if remote#host#IsRunning(a:host)
+ if has_key(s:hosts, a:host) && remote#host#IsRunning(a:host)
" For now we won't allow registration of plugins when the host is already
" running.
throw 'Host "'.a:host.'" is already running'
@@ -189,16 +193,14 @@ endfunction
" Registration of standard hosts
" Python/Python3 {{{
-function! s:RequirePythonHost(name)
- let ver_name = has_key(s:hosts[a:name], 'orig_name') ?
- \ s:hosts[a:name].orig_name : a:name
- let ver = (ver_name ==# 'python') ? 2 : 3
+function! s:RequirePythonHost(host)
+ let ver = (a:host.orig_name ==# 'python') ? 2 : 3
" Python host arguments
let args = ['-c', 'import neovim; neovim.start_host()']
" Collect registered Python plugins into args
- let python_plugins = remote#host#PluginsForHost(a:name)
+ let python_plugins = remote#host#PluginsForHost(a:host.name)
for plugin in python_plugins
call add(args, plugin.path)
endfor