diff options
author | Nick Hynes <nhynes@mit.edu> | 2015-06-28 08:54:42 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-07-03 12:12:21 -0400 |
commit | 0ffd51425e70525bdbc792a1c6592f807b84e212 (patch) | |
tree | ef2a47f2ceab23eeb25a569ddf59bfe6ebcdd400 | |
parent | b4d45f635dec20f49832666ef9f59069b293827e (diff) | |
download | rneovim-0ffd51425e70525bdbc792a1c6592f807b84e212.tar.gz rneovim-0ffd51425e70525bdbc792a1c6592f807b84e212.tar.bz2 rneovim-0ffd51425e70525bdbc792a1c6592f807b84e212.zip |
rplugin: pass additional info to host factory function #2920
-rw-r--r-- | runtime/autoload/remote/host.vim | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim index 5a3097af5d..ddbdc2d7f2 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 @@ -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 |