Skip to content

feat(handlers/gitsigns): show staged hunks in scrollbar#95

Open
choby-shun wants to merge 2 commits into
lewis6991:mainfrom
choby-shun:feat/staged-hunks
Open

feat(handlers/gitsigns): show staged hunks in scrollbar#95
choby-shun wants to merge 2 commits into
lewis6991:mainfrom
choby-shun:feat/staged-hunks

Conversation

@choby-shun

@choby-shun choby-shun commented May 1, 2026

Copy link
Copy Markdown

Previously the gitsigns handler only rendered unstaged hunks (returned by gitsigns' public get_hunks API). After staging changes, the scrollbar indicators would disappear even though gitsigns still tracks them.

Read staged hunks directly from gitsigns.cache and render them with new SatelliteGitSignsStaged{Add,Change,Delete} highlight groups (linked to GitSignsStaged* with a fallback to GitSigns*). Behavior is configurable via the new staged.{enable,signs} options and is off by default.

Previously the gitsigns handler only rendered unstaged hunks (returned by
gitsigns' public get_hunks API). After staging changes, the scrollbar
indicators would disappear even though gitsigns still tracks them.

Read staged hunks directly from gitsigns.cache and render them with new
SatelliteGitSignsStaged{Add,Change,Delete} highlight groups (linked to
GitSignsStaged* with a fallback to GitSigns*). Behavior is configurable
via the new staged.{enable,signs} options and is on by default.
@justinmk

justinmk commented May 1, 2026

Copy link
Copy Markdown

If this is accepted, my vote would be to disable it by default. One of the main uses of gitsigns for me is to get visual feedback when I stage something...

Opt-in is safer for users upgrading: scrollbar appearance shouldn't
change unless explicitly requested. Set staged.enable = true in opts to
restore the previous default.
@choby-shun

Copy link
Copy Markdown
Author

Hi @justinmk, that’s a fair point. I completely agree. I should have kept the default behavior intact. I’ve updated the PR to be opt-in only.

To maintainers:
Please feel free to merge this if you think it adds value to the project, but I’m also happy to close it if you'd prefer to keep the core functionality more lean. Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants