feat(handlers/gitsigns): show staged hunks in scrollbar#95
Open
choby-shun wants to merge 2 commits into
Open
Conversation
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.
|
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.
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
offby default.