aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/provider/python3.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload/provider/python3.vim')
-rw-r--r--runtime/autoload/provider/python3.vim16
1 files changed, 11 insertions, 5 deletions
diff --git a/runtime/autoload/provider/python3.vim b/runtime/autoload/provider/python3.vim
index 1a52ade0ef..f469bf55aa 100644
--- a/runtime/autoload/provider/python3.vim
+++ b/runtime/autoload/provider/python3.vim
@@ -10,10 +10,6 @@ endif
let g:loaded_python3_provider = 1
let [s:prog, s:err] = provider#pythonx#Detect(3)
-if s:prog == ''
- " Detection failed
- finish
-endif
function! provider#python3#Prog()
return s:prog
@@ -23,6 +19,11 @@ function! provider#python3#Error()
return s:err
endfunction
+if s:prog == ''
+ " Detection failed
+ finish
+endif
+
let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
" The Python3 provider plugin will run in a separate instance of the Python3
@@ -31,6 +32,9 @@ call remote#host#RegisterClone('legacy-python3-provider', 'python3')
call remote#host#RegisterPlugin('legacy-python3-provider', s:plugin_path, [])
function! provider#python3#Call(method, args)
+ if s:err != ''
+ return
+ endif
if !exists('s:host')
let s:rpcrequest = function('rpcrequest')
@@ -38,10 +42,12 @@ function! provider#python3#Call(method, args)
try
let s:host = remote#host#Require('legacy-python3-provider')
catch
+ let s:err = v:exception
+ echohl WarningMsg
echomsg v:exception
+ echohl None
finish
endtry
endif
-
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
endfunction