fix(git): validate placement, cache repo lookups, tighten lifecycle

This commit is contained in:
2026-05-10 04:47:35 +02:00
parent cb47177382
commit 8624f825eb
4 changed files with 35 additions and 2 deletions
+7 -1
View File
@@ -58,12 +58,18 @@ local function update_buf(buf, r)
end
repo.on("refresh", function(r)
local any_visible = false
for buf in pairs(r.buffers) do
if vim.api.nvim_buf_is_loaded(buf) then
update_buf(buf, r)
if not any_visible and #vim.fn.win_findbuf(buf) > 0 then
any_visible = true
end
end
end
vim.cmd.redrawstatus({ bang = true })
if any_visible then
vim.cmd.redrawstatus({ bang = true })
end
end)
vim.api.nvim_create_autocmd("BufWinEnter", {