Skip to content

Commit f6df58a

Browse files
committed
fix: bug in buffer rendering race condition handling
1 parent 4c574cf commit f6df58a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/oil/view.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ local function get_used_columns()
737737
return cols
738738
end
739739

740+
---@type table<integer, fun(message: string)[]>
740741
local pending_renders = {}
741742

742743
---@param bufnr integer
@@ -772,7 +773,7 @@ M.render_buffer_async = function(bufnr, opts, callback)
772773
vim.bo[bufnr].undolevels = vim.api.nvim_get_option_value("undolevels", { scope = "global" })
773774
util.render_text(bufnr, { "Error: " .. message })
774775
if pending_renders[bufnr] then
775-
for _, cb in ipairs(pending_renders) do
776+
for _, cb in ipairs(pending_renders[bufnr]) do
776777
cb(message)
777778
end
778779
pending_renders[bufnr] = nil

0 commit comments

Comments
 (0)