mookid / diffr

Yet another diff highlighting tool
MIT License
575 stars 22 forks source link

Avoid skipping dots and other special chars #24

Closed kgrz closed 4 years ago

kgrz commented 5 years ago

I've put up a repo for demonstrating this: https://github.com/kgrz/diffr-issue

I've seen this happen with dots, hyphens, = and some words too. Another example:

Screenshot 2019-09-10 at 14 44 53

kgrz commented 5 years ago

I rechecked this with a dark theme, without any extra configs for diffr v0.1.2:

Screenshot 2019-09-10 at 14 47 40

Ignore the part with the blue background. That's just search result highlighting in less.

mookid commented 5 years ago

Ok, so the issue is this diff: image

dot is treated as a word of its own, and is part of the LCS in the first diff: the . following 10 matches the one following example.

This allows to highlight finer differences: for instance,

-foo.bar.baz
+foo.bar.baq

diffr should highlight baz and baq, rather than the whole lines.

What do you expect the highlighting to be?