Skip to content

Commit 80037d2

Browse files
committed
refactor: check for nil timer
1 parent 79899e9 commit 80037d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/copilot-lsp/util.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ end
1313
---@param delay integer
1414
function M.debounce(fn, delay)
1515
local timer = vim.uv.new_timer()
16+
if not timer then
17+
return fn
18+
end
19+
1620
return function(...)
1721
local argv = vim.F.pack_len(...)
1822
timer:start(delay, 0, function()

0 commit comments

Comments
 (0)