perf(git): minor performance cleanups
This commit is contained in:
+5
-1
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user