diff --git a/lua/avante/path.lua b/lua/avante/path.lua index c3136eb..f089c4a 100644 --- a/lua/avante/path.lua +++ b/lua/avante/path.lua @@ -49,10 +49,10 @@ end -- Saves the chat history for the given buffer. ---@param bufnr integer ---@param history table -History.save = function(bufnr, history) +History.save = vim.schedule_wrap(function(bufnr, history) local history_file = History.get(bufnr) history_file:write(vim.json.encode(history), "w") -end +end) P.history = History