aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_editor.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/_editor.lua')
-rw-r--r--runtime/lua/vim/_editor.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua
index 453aa6ac81..f7dcc3a81b 100644
--- a/runtime/lua/vim/_editor.lua
+++ b/runtime/lua/vim/_editor.lua
@@ -408,7 +408,9 @@ function vim.defer_fn(fn, timeout)
timeout,
0,
vim.schedule_wrap(function()
- timer:close()
+ if not timer:is_closing() then
+ timer:close()
+ end
fn()
end)