Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying a different style for diff indicator in vcs gutter #8343

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

amousset
Copy link
Contributor

@amousset amousset commented Sep 20, 2023

Currently the diff.plus/minus/delta keys are used both for the gutter indicator and the syntax highlighting (for example in .patch files). This limits the abilities to theme the diffs nicely, as the background appear in the gutter line. For example, with existing papercolor_light theme this gives:

image

It is also hard to find a good color as the gutter indicator needs to be very colored as it has a very small surface, but it forces a very bright text.

This change allows using a different style for the gutter diff indicator, allowing things like:

image

with:

"diff.plus" = { fg = "fg-added", bg = "bg-added" }
"diff.plus.gutter" = "green-intense"
"diff.minus" = { fg = "fg-removed", bg = "bg-removed" }
"diff.minus.gutter" = "red-intense"
"diff.delta" = { fg = "fg-changed", bg = "bg-changed" }
"diff.delta.gutter" = "yellow-intense"

Making it a subkey allows maintaining compatibility with existing themes. Another option could be to add it to the ui key with a fallback on diff.

This allows using a background in diff style
(for nice patch file coloring) while keeping the
gutter indicator nice (and using appropriate colors).
@the-mikedavis the-mikedavis added E-easy Call for participation: Experience needed to fix: Easy / not much A-theme Area: Theme and appearence related S-waiting-on-review Status: Awaiting review from a maintainer. labels Sep 20, 2023
@pascalkuthe pascalkuthe merged commit 2284bce into helix-editor:master Sep 20, 2023
6 checks passed
danillos pushed a commit to danillos/helix that referenced this pull request Nov 21, 2023
…elix-editor#8343)

This allows using a background in diff style
(for nice patch file coloring) while keeping the
gutter indicator nice (and using appropriate colors).
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
…elix-editor#8343)

This allows using a background in diff style
(for nice patch file coloring) while keeping the
gutter indicator nice (and using appropriate colors).
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
…elix-editor#8343)

This allows using a background in diff style
(for nice patch file coloring) while keeping the
gutter indicator nice (and using appropriate colors).
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
…elix-editor#8343)

This allows using a background in diff style
(for nice patch file coloring) while keeping the
gutter indicator nice (and using appropriate colors).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-theme Area: Theme and appearence related E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants