fix(save): schedule save within a loop (#560)

This commit is contained in:
Leiser Fernández Gallo 2024-10-10 14:04:37 +02:00 committed by GitHub
parent 4132485487
commit ec31f348b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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