fix(rpc): break nvim_error_event feedback loop between two nvim instances

In case nvim A sends nvim_error_event to nvim B, it would
respond with another nvim_error_event due to unknown
request name. Fix this by adding dummy request handler for now.
This commit is contained in:
bfredl
2022-07-09 14:48:09 +02:00
parent 0b63f5afad
commit f87c824513
3 changed files with 12 additions and 3 deletions

View File

@@ -91,7 +91,7 @@ local deprecated_aliases = require("api.dispatch_deprecated")
for _,f in ipairs(shallowcopy(functions)) do
local ismethod = false
if startswith(f.name, "nvim_") then
if startswith(f.name, "nvim__") then
if startswith(f.name, "nvim__") or f.name == "nvim_error_event" then
f.since = -1
elseif f.since == nil then
print("Function "..f.name.." lacks since field.\n")
@@ -149,7 +149,7 @@ local exported_attributes = {'name', 'return_type', 'method',
'since', 'deprecated_since'}
local exported_functions = {}
for _,f in ipairs(functions) do
if not startswith(f.name, "nvim__") then
if not (startswith(f.name, "nvim__") or f.name == "nvim_error_event") then
local f_exported = {}
for _,attr in ipairs(exported_attributes) do
f_exported[attr] = f[attr]