Note the different color code on the ANSI escape right before the match.
I think the most obvious way to fix this would be to retrieve and parse git's color configuration (e.g. using something like anstyle-git), render the result as an ANSI escape sequence, and match against that.
[x] Please include the raw text output from git, so that we can reproduce the problem.
(You can use git --no-pager to produce the raw text output.)
[x] A screenshot of Delta's output is often helpful also.
If the user's git configuration customizes
color.grep.match
, delta won't recognize and highlight matches.For instance, here's
git grep 'Get Started'
in thedelta
repository with my configuration, which setscolor.grep.match = 'bold green'
:Here's the same grep with the default
git grep
color configuration:Here's the raw text output as a hexdump (using
-c color.pager=hd
) in both cases:With
color.grep.match = 'bold green'
:With the default
color.grep.match = 'bold red'
:Note the different color code on the ANSI escape right before the match.
I think the most obvious way to fix this would be to retrieve and parse git's color configuration (e.g. using something like
anstyle-git
), render the result as an ANSI escape sequence, and match against that.git --no-pager
to produce the raw text output.)Thanks for filing a Delta bug report!