fix: bug in buffer rendering race condition handling
This commit is contained in:
parent
4c574cf4a2
commit
f6df58ad37
1 changed files with 2 additions and 1 deletions
|
|
@ -737,6 +737,7 @@ local function get_used_columns()
|
||||||
return cols
|
return cols
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@type table<integer, fun(message: string)[]>
|
||||||
local pending_renders = {}
|
local pending_renders = {}
|
||||||
|
|
||||||
---@param bufnr integer
|
---@param bufnr integer
|
||||||
|
|
@ -772,7 +773,7 @@ M.render_buffer_async = function(bufnr, opts, callback)
|
||||||
vim.bo[bufnr].undolevels = vim.api.nvim_get_option_value("undolevels", { scope = "global" })
|
vim.bo[bufnr].undolevels = vim.api.nvim_get_option_value("undolevels", { scope = "global" })
|
||||||
util.render_text(bufnr, { "Error: " .. message })
|
util.render_text(bufnr, { "Error: " .. message })
|
||||||
if pending_renders[bufnr] then
|
if pending_renders[bufnr] then
|
||||||
for _, cb in ipairs(pending_renders) do
|
for _, cb in ipairs(pending_renders[bufnr]) do
|
||||||
cb(message)
|
cb(message)
|
||||||
end
|
end
|
||||||
pending_renders[bufnr] = nil
|
pending_renders[bufnr] = nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue