Skip to content

Commit 1998e64

Browse files
committed
fix(component): redraw statusline immediately after gitsigns change
1 parent 8bf267c commit 1998e64

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lua/astroui/status/component.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ function M.git_branch(opts)
195195
if is_available "telescope.nvim" then require("telescope.builtin").git_branches { use_file_path = true } end
196196
end,
197197
},
198-
update = { "User", pattern = "GitSignsUpdate" },
198+
update = {
199+
"User",
200+
pattern = { "GitSignsUpdate", "GitSignsChanged" },
201+
callback = function() vim.schedule(vim.cmd.redrawstatus) end,
202+
},
199203
init = init.update_events { "BufEnter" },
200204
}, opts)
201205
return M.builder(status_utils.setup_providers(opts, { "git_branch" }))
@@ -218,7 +222,11 @@ function M.git_diff(opts)
218222
end,
219223
},
220224
surround = { separator = "left", color = "git_diff_bg", condition = condition.git_changed },
221-
update = { "User", pattern = "GitSignsUpdate" },
225+
update = {
226+
"User",
227+
pattern = { "GitSignsUpdate", "GitSignsChanged" },
228+
callback = function() vim.schedule(vim.cmd.redrawstatus) end,
229+
},
222230
init = init.update_events { "BufEnter" },
223231
}, opts)
224232
return M.builder(status_utils.setup_providers(opts, { "added", "changed", "removed" }, function(p_opts, p)

0 commit comments

Comments
 (0)