Skip to content

Conversation

gerhardol
Copy link
Member

Proposed changes

  • fix: MakeBackgroundDarkerBy for colors instead of known names
    To simplify a few changes

  • feat: bold-bold ansi terminal colors

Some terminals allow bold-bold colors.
For instance Difftastic emits this in dark mode.

Handle dark mode for ansi default text color.

Add a way to generate AnsiTerminalColors.diff,
to display the terminal colors.
(Requires commenting out code.)

Note: I ended up proposing another solution for dark mode other than bold-bold.

Screenshots

There are no diff for normal output, but the bold-bold is displayed and the "test file" is updated.
The bold-bold were not visible before

Before

image

image

After

image

Test methodology

Added tests, also for existing

Merge strategy

  • Rebase merge (PR submitter must change the commit message for the last commit).

✒️ I contribute this code under The Developer Certificate of Origin.

@gerhardol gerhardol changed the title Feature/ansi bold bold feat: bold-bold ansi terminal colors Feb 9, 2025
Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looked sensible in a brief scan.
I have not noticed any side-effect to the default theme (without difft).

@gerhardol
Copy link
Member Author

I have not noticed any side-effect to the default theme (without difft).

There is no difference also with difft with the default theme, I have not seen any Git usage of bold-bold so there should be none.

@mstv
Copy link
Member

mstv commented Feb 11, 2025

I have not noticed any side-effect to the default theme (without difft).

There is no difference also with difft with the default theme, I have not seen any Git usage of bold-bold so there should be none.

It was my justification for skipping a detailed review and testing myself. The added testcases pass.

Some terminals allow bold-bold colors.
For instance Difftastic emitts this in dark mode.

Handle dark mode for ansi default text color.

Add a way to generate AnsiTerminalColors.diff,
to display the terminal colors.
(Requires commenting out code.)

Refs: gitextensions#12189
@gerhardol gerhardol force-pushed the feature/ansi-bold-bold branch from 5db7215 to e106d58 Compare February 18, 2025 20:30
@gerhardol gerhardol merged commit 39efa6b into gitextensions:master Feb 18, 2025
3 of 4 checks passed
@gerhardol gerhardol deleted the feature/ansi-bold-bold branch February 18, 2025 20:45
@mstv mstv added this to the v5.3 milestone Feb 18, 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