Re:Show HN: GitHub style split diffs in your terminal
by airblade on Sunday May 02, 2021 @03:23AM
(#27013030)
You can't configure diff-highlight to do that. It 'will find the common prefix and suffix of two lines, and consider everything in the middle to be "different".' [1]
To highlight only the quotes as changing, you need something else. On (Neo)Vim, for example, vim-gitgutter does this [2] (I'm the author).
[1] https://github.com/git/git/tree/master/contrib/diff-highligh... [2] https://github.com/airblade/vim-gitgutter/blob/master/autolo...
Re:Show HN: GitHub style split diffs in your terminal
by i_am_not_elon on Sunday May 02, 2021 @01:12PM
(#27016898)
Thank you! I’ll check it out. I appreciate it!
Re:Show HN: GitHub style split diffs in your terminal
by i_am_not_elon on Sunday May 02, 2021 @09:23PM
(#27020693)
gitgutter is amazing, btw. thank you.
Have you (or anyone reading this) been able to figure out how to get diff-highlight to be more intelligent so that if 'foo' changes to "foo", the highlighter is smart enough to only highlight the quotes as changing, but not the word foo? (Though this example is trivial, any time you've got two changes on the same line, this issue occurs where everything in between those changes gets highlighted as well.) I noticed that other tools in this thread such as delta and banga don't suffer from this issue.