Skip to content

Commit

Permalink
fix(save): schedule save within a loop (yetone#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
leiserfg authored Oct 10, 2024
1 parent 4132485 commit ec31f34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/avante/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ec31f34

Please sign in to comment.