From b05374428e5136d9b6c8e1e8e62a75f82283b1f8 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Tue, 10 Sep 2024 11:44:04 -0700 Subject: [PATCH] fix: wrap git rm callback in schedule_wrap (#475) --- lua/oil/adapters/files.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/oil/adapters/files.lua b/lua/oil/adapters/files.lua index e007423..f65cbf7 100644 --- a/lua/oil/adapters/files.lua +++ b/lua/oil/adapters/files.lua @@ -554,13 +554,13 @@ M.perform_action = function(action, cb) if config.git.rm(path) then local old_cb = cb - cb = function(err) + cb = vim.schedule_wrap(function(err) if not err then git.rm(path, old_cb) else old_cb(err) end - end + end) end if config.delete_to_trash then