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

πŸš€ Minimal color mode reusing the default colors #193

Closed
waldyrious opened this issue May 16, 2020 · 5 comments
Closed

πŸš€ Minimal color mode reusing the default colors #193

waldyrious opened this issue May 16, 2020 · 5 comments

Comments

@waldyrious
Copy link
Contributor

I've been using git's diff-highlight script and I like the way it handles colors β€” it supports inline insertion/deletion highlighting (not as well as delta) using the reversed/negative style based on the same red/green colors used for the non-highlighted parts.

I would love if delta had an option to do the same. Right now, the difference is quite jarring to my eyes:

git diff-highlight
diff diff-highlight
delta --color-only delta
diff-delta--color-only diff-delta

For comparison, here's what diff-so-fancy does. Note how it reuses the original colors for added/deleted text, as well as for the file and hunk headers (although it does introduce a different shade of green for the inline highlight, which I've reported in so-fancy/diff-so-fancy#374):

diff-so-fancy

@waldyrious
Copy link
Contributor Author

By the way, shouldn't the "yeah" part of the diff be highlighted by delta? Is that a bug?

@dandavison
Copy link
Owner

Hi @waldyrious, this is awesome and very helpful, thanks very much. The good news is I'm working on this right now. (See also #177).

By the way, shouldn't the "yeah" part of the diff be highlighted by delta? Is that a bug?

Does it highlight with a value like --max-line-distance=0.7? See #140 for discussion. If you were able to try out the experimental environment variable introduced in #140 or otherwise provide feedback on improving the defaults for within-line edit highlighting that would be fantastic too.

@waldyrious
Copy link
Contributor Author

The good news is I'm working on this right now. (See also #177).

Yay! That's great to hear. πŸŽ‰

Does it highlight with a value like --max-line-distance=0.7?

It still doesn't. 😒 I tried with various values, but none worked to highlight just the "yeah" part of the line. In any case, that's a discussion to continue in #140 :) I'll follow that thread and chime in with any feedback I can provide.

@dandavison
Copy link
Owner

dandavison commented May 29, 2020

@waldyrious I believe this is now fixed in master (not released yet). Please see the write-up in #205 for full details.

delta --minus-style=red --minus-emph-style='reverse red'
      --plus-style=green --plus-emph-style='reverse green'
image

reverse is a style attribute that is now supported by delta, in addition to bold, dimmed, ul, etc. There are some alternative ways of doing the same thing here, e.g. instead of using reverse with a foreground color, one could give foreground and background colors like --minus-emph-style='normal red'.

Closing because I believe fixed but let me know if not!

Next up: what is going on with that foo yeah not highlighting! (I certainly see that you're right and it does not highlight even with --max-line-distance 1.0.)

@waldyrious
Copy link
Contributor Author

Nice! Thanks for the quick fix :)

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

No branches or pull requests

2 participants