Skip to content

Commit 7e147e8

Browse files
authored
fix(loop): schedule debounced callbacks and check closed status (#437)
1 parent 77ebbeb commit 7e147e8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lua/vgit/core/loop.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ function loop.debounce(fn, ms)
3131

3232
timer:stop()
3333
timer:start(ms, 0, function()
34-
fn(unpack(argv, 1, argc))
34+
vim.schedule(function()
35+
if not closed then
36+
fn(unpack(argv, 1, argc))
37+
end
38+
end)
3539
end)
3640
end
3741

0 commit comments

Comments
 (0)