mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
API: emit nvim_error_event on failed async request
We already do this for _invalid_ async requests #9300. Now we also do it for failed invocation of valid requests.
This commit is contained in:
@@ -627,6 +627,19 @@ local function table_flatten(arr)
|
||||
return result
|
||||
end
|
||||
|
||||
-- Checks if a list-like (vector) table contains `value`.
|
||||
local function table_contains(t, value)
|
||||
if type(t) ~= 'table' then
|
||||
error('t must be a table')
|
||||
end
|
||||
for _,v in ipairs(t) do
|
||||
if v == value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function hexdump(str)
|
||||
local len = string.len(str)
|
||||
local dump = ""
|
||||
@@ -771,6 +784,7 @@ local module = {
|
||||
repeated_read_cmd = repeated_read_cmd,
|
||||
shallowcopy = shallowcopy,
|
||||
sleep = sleep,
|
||||
table_contains = table_contains,
|
||||
table_flatten = table_flatten,
|
||||
tmpname = tmpname,
|
||||
uname = uname,
|
||||
|
Reference in New Issue
Block a user