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

feat(gitsign): improve gitsign inline add and delete colors #808

Conversation

AndreasNasman
Copy link
Contributor

This PR aims to improve the colors of changed text when running :Gitsigns preview_hunk with transparent_background = false (see the screenshot below).

For the dark themes, the cursor color seems to "conflict" with the diff colors, making it hard to track the cursor if focusing a hunk and, e.g., copying some text.

For GitSignsAddInline, it took the color of

DiffAdd = { bg = U.darken(C.green, 0.18, C.base) }, -- diff mode: Added line |diff.txt|
and doubled the amount from 18 to 36. I did the same with GitSignsDeleteInline and
DiffDelete = { bg = U.darken(C.red, 0.18, C.base) }, -- diff mode: Deleted line |diff.txt|

Latte

Before

image

After

image

Frappe

Before

image

After

image

Macchiato

Before

image

After

image

Mocha

Before

image

After

image

@AndreasNasman
Copy link
Contributor Author

I'm unsure if I should add some O.transparent_background checks. Since

if O.transparent_background then
already does an outer check for the truthiness of O.transparent_background, I don't follow why the inner checks like
GitSignsAddPreview = O.transparent_background and { fg = C.green, bg = C.none } or { link = "DiffAdd" },
are needed.

@vollowx vollowx force-pushed the improve-gitsigns-hunk-inline-diff-colors branch from 5a21309 to 226dbdb Compare January 30, 2025 11:39
@vollowx
Copy link
Collaborator

vollowx commented Jan 30, 2025

I'm unsure if I should add some O.transparent_background checks. Since

if O.transparent_background then

already does an outer check for the truthiness of O.transparent_background, I don't follow why the inner checks like

GitSignsAddPreview = O.transparent_background and { fg = C.green, bg = C.none } or { link = "DiffAdd" },

are needed.

That makes sense, we could fix this in another PR.

@vollowx vollowx changed the title fix(gitsign): improve gitsign inline add and delete colors feat(gitsign): improve gitsign inline add and delete colors Jan 30, 2025
@vollowx vollowx merged commit 4965db2 into catppuccin:main Jan 30, 2025
8 checks passed
AndreasNasman added a commit to AndreasNasman/.config that referenced this pull request Feb 4, 2025
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