mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
provider/python: Call: fix usage of 'finish' in function
Do not call it again in case of an exception in `remote#host#Require` (ref: https://github.com/neovim/neovim/pull/2549#issuecomment-102674350).
This commit is contained in:
parent
866e587b88
commit
2111f28fc5
runtime/autoload/provider
@ -32,6 +32,9 @@ call remote#host#RegisterClone('legacy-python-provider', 'python')
|
||||
call remote#host#RegisterPlugin('legacy-python-provider', s:plugin_path, [])
|
||||
|
||||
function! provider#python#Call(method, args)
|
||||
if s:err != ''
|
||||
return
|
||||
endif
|
||||
if !exists('s:host')
|
||||
let s:rpcrequest = function('rpcrequest')
|
||||
|
||||
@ -39,7 +42,10 @@ function! provider#python#Call(method, args)
|
||||
try
|
||||
let s:host = remote#host#Require('legacy-python-provider')
|
||||
catch
|
||||
let s:err = v:exception
|
||||
echohl WarningMsg
|
||||
echomsg v:exception
|
||||
echohl None
|
||||
finish
|
||||
endtry
|
||||
endif
|
||||
|
@ -32,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')
|
||||
|
||||
@ -39,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
|
||||
|
Loading…
Reference in New Issue
Block a user