perf(git): minor performance cleanups

This commit is contained in:
2026-04-27 13:27:22 +02:00
parent 5966454462
commit 20dc6cc3c9
4 changed files with 51 additions and 30 deletions
+5 -1
View File
@@ -149,6 +149,7 @@ local function do_refresh(repo)
format(code)
end
end
local dirty = false
for buf in pairs(repo.buffers) do
if not vim.api.nvim_buf_is_valid(buf) then
repo.buffers[buf] = nil
@@ -156,10 +157,13 @@ local function do_refresh(repo)
local status = statuses[vim.api.nvim_buf_get_name(buf)]
if vim.b[buf].git_status ~= status then
vim.b[buf].git_status = status
vim.cmd.redrawstatus({ bang = true })
dirty = true
end
end
end
if dirty then
vim.cmd.redrawstatus({ bang = true })
end
vim.api.nvim_exec_autocmds("User", {
pattern = "GitRefresh",
data = { gitdir = repo.gitdir, worktree = repo.worktree },