diff --git a/lua/gitsigns/debounce.lua b/lua/gitsigns/debounce.lua index 98c58a174..3b1224998 100644 --- a/lua/gitsigns/debounce.lua +++ b/lua/gitsigns/debounce.lua @@ -17,9 +17,7 @@ function M.debounce_trailing(ms, fn) return function(...) local argv = { ... } timer:start(ms, 0, function() - if not timer:is_closing() then - timer:close() - end + timer:stop() fn(unpack(argv)) end) end @@ -38,9 +36,7 @@ function M.throttle_leading(ms, fn) if not running then timer:start(ms, 0, function() running = false - if not timer:is_closing() then - timer:close() - end + timer:stop() end) running = true fn(...) diff --git a/teal/gitsigns/debounce.tl b/teal/gitsigns/debounce.tl index 79fe7aa8d..34d7c00f7 100644 --- a/teal/gitsigns/debounce.tl +++ b/teal/gitsigns/debounce.tl @@ -17,9 +17,7 @@ function M.debounce_trailing(ms: number, fn: function): function return function(...) local argv = {...} timer:start(ms, 0, function() - if not timer:is_closing() then - timer:close() - end + timer:stop() fn(unpack(argv)) end) end @@ -38,9 +36,7 @@ function M.throttle_leading(ms: number, fn: function): function if not running then timer:start(ms, 0, function() running = false - if not timer:is_closing() then - timer:close() - end + timer:stop() end) running = true fn(...)