fix(git): validate placement, cache repo lookups, tighten lifecycle
This commit is contained in:
@@ -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", {
|
||||
|
||||
Reference in New Issue
Block a user