From e05312f83bcc90d5b65a4e1f8574bc3546cf95dd Mon Sep 17 00:00:00 2001 From: yetone Date: Mon, 17 Mar 2025 04:05:22 +0800 Subject: [PATCH] fix: reset buffer (#1608) --- lua/avante/sidebar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index ea7e349..b8a6bef 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -3057,7 +3057,7 @@ function Sidebar:render(opts) -- reset states when buffer is closed api.nvim_buf_attach(self.code.bufnr, false, { on_detach = function(_, _) - if self and self.reset then self:reset() end + if self and self.reset then vim.schedule(function() self:reset() end) end end, })