aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/provider/python.vim
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-11-18 15:57:42 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-18 15:57:42 -0300
commit9e37c1d3b6b9d0d35d7f7558d3efb555757278c0 (patch)
treeabff58ba79dddfbf4d3667c7fdcf1642546f4c51 /runtime/autoload/provider/python.vim
parenta67fd6f21378bc01b41e5349abff2eb214f6c288 (diff)
parentd971cb169184a1fa59e93a5216635261d8c47e11 (diff)
downloadrneovim-9e37c1d3b6b9d0d35d7f7558d3efb555757278c0.tar.gz
rneovim-9e37c1d3b6b9d0d35d7f7558d3efb555757278c0.tar.bz2
rneovim-9e37c1d3b6b9d0d35d7f7558d3efb555757278c0.zip
Merge PR #1454 'Refactor plugin system'
Diffstat (limited to 'runtime/autoload/provider/python.vim')
-rw-r--r--runtime/autoload/provider/python.vim28
1 files changed, 28 insertions, 0 deletions
diff --git a/runtime/autoload/provider/python.vim b/runtime/autoload/provider/python.vim
new file mode 100644
index 0000000000..9ca81c35f4
--- /dev/null
+++ b/runtime/autoload/provider/python.vim
@@ -0,0 +1,28 @@
+" The python provider uses a python host to emulate an environment for running
+" python-vim plugins(:h python-vim). See :h nvim-providers for more
+" information.
+"
+" Associating the plugin with the python host is the first step because plugins
+" will be passed as command-line arguments
+if exists('s:loaded_python_provider') || &cp
+ finish
+endif
+let s:loaded_python_provider = 1
+let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
+" The python provider plugin will run in a separate instance of the python
+" host.
+call rpc#host#RegisterClone('legacy-python-provider', 'python')
+call rpc#host#RegisterPlugin('legacy-python-provider', s:plugin_path, [])
+" Ensure that we can load the python host before bootstrapping
+try
+ let s:host = rpc#host#Require('legacy-python-provider')
+catch
+ echomsg v:exception
+ finish
+endtry
+
+let s:rpcrequest = function('rpcrequest')
+
+function! provider#python#Call(method, args)
+ return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
+endfunction