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.
|
-- Saves the chat history for the given buffer.
|
||||||
---@param bufnr integer
|
---@param bufnr integer
|
||||||
---@param history table
|
---@param history table
|
||||||
History.save = function(bufnr, history)
|
History.save = vim.schedule_wrap(function(bufnr, history)
|
||||||
local history_file = History.get(bufnr)
|
local history_file = History.get(bufnr)
|
||||||
history_file:write(vim.json.encode(history), "w")
|
history_file:write(vim.json.encode(history), "w")
|
||||||
end
|
end)
|
||||||
|
|
||||||
P.history = History
|
P.history = History
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user