mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
rplugin: pass additional info to host factory function #2920
This commit is contained in:
parent
b4d45f635d
commit
0ffd51425e
@ -40,7 +40,11 @@ function! remote#host#Require(name)
|
|||||||
endif
|
endif
|
||||||
let host = s:hosts[a:name]
|
let host = s:hosts[a:name]
|
||||||
if !host.channel && !host.initialized
|
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
|
let host.initialized = 1
|
||||||
endif
|
endif
|
||||||
return host.channel
|
return host.channel
|
||||||
@ -189,16 +193,14 @@ endfunction
|
|||||||
" Registration of standard hosts
|
" Registration of standard hosts
|
||||||
|
|
||||||
" Python/Python3 {{{
|
" Python/Python3 {{{
|
||||||
function! s:RequirePythonHost(name)
|
function! s:RequirePythonHost(host)
|
||||||
let ver_name = has_key(s:hosts[a:name], 'orig_name') ?
|
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
||||||
\ s:hosts[a:name].orig_name : a:name
|
|
||||||
let ver = (ver_name ==# 'python') ? 2 : 3
|
|
||||||
|
|
||||||
" Python host arguments
|
" Python host arguments
|
||||||
let args = ['-c', 'import neovim; neovim.start_host()']
|
let args = ['-c', 'import neovim; neovim.start_host()']
|
||||||
|
|
||||||
" Collect registered Python plugins into args
|
" 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
|
for plugin in python_plugins
|
||||||
call add(args, plugin.path)
|
call add(args, plugin.path)
|
||||||
endfor
|
endfor
|
||||||
|
Loading…
Reference in New Issue
Block a user