refactor: replace vim.uv.* asserts with warn-and-bail
This commit is contained in:
+14
-1
@@ -304,7 +304,20 @@ end
|
||||
---@param delay integer
|
||||
---@return F, ow.Util.DebounceHandle
|
||||
function M.debounce(fn, delay)
|
||||
local timer = assert(vim.uv.new_timer())
|
||||
local timer, err = vim.uv.new_timer()
|
||||
if not timer then
|
||||
M.warning("debounce: failed to create timer: %s", err)
|
||||
local noop = function() end
|
||||
return fn,
|
||||
{
|
||||
cancel = noop,
|
||||
flush = noop,
|
||||
pending = function()
|
||||
return false
|
||||
end,
|
||||
close = noop,
|
||||
}
|
||||
end
|
||||
local args ---@type table?
|
||||
local gen = 0
|
||||
local fired_gen = 0
|
||||
|
||||
Reference in New Issue
Block a user