fix(save): schedule save within a loop (#560)
This commit is contained in:
parent
4132485487
commit
ec31f348b2
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user