diffr icon indicating copy to clipboard operation
diffr copied to clipboard

diffr highlights the whole lies instead of the last character of each line.

Open ghuls opened this issue 5 years ago • 4 comments

diffr highlights the whole lies instead of the last character of each line:

--- /dev/fd/63	2020-04-17 11:50:36.529229290 +0200
+++ /dev/fd/62	2020-04-17 11:50:36.529229290 +0200
@@ -1,27 +1,27 @@
-ATCACGG
-CGATGTG
-TTAGGCG
-TGACCAG
-ACAGTGG
-GCCAATG
-CAGATCG
-ACTTGAG
-GATCAGG
-TAGCTTG
-GGCTACG
-CTTGTAG
-AGTCAAG
+ATCACGA
+CGATGTA
+TTAGGCA
+TGACCAA
+ACAGTGA
+GCCAATA
+CAGATCA
+ACTTGAA
+GATCAGA
+TAGCTTA
+GGCTACA
+CTTGTAA
+AGTCAAC
 AGTTCCG
 ATGTCAG
-CCGTCCG
-GTAGAGG
-GTCCGCG
-GTGAAAG
-GTGGCCG
+CCGTCCC
+
+GTCCGCA
+GTGAAAC
+GTGGCCT
 GTTTCGG
-CGTACGG
-GAGTGGG
-GGTAGCG
-ACTGATG
-ATGAGCG
-ATTCCTG
+CGTACGT
+GAGTGGA
+
+ACTGATA
+
+ATTCCTT

ghuls avatar Apr 17 '20 09:04 ghuls

@ghuls this is by design; highlighting units stops at word boundary (for some definition of word). Here each line is a whole word. see https://github.com/mookid/diffr/blob/77b9a2b/diffr-lib/src/lib.rs#L555.

mookid avatar Apr 17 '20 17:04 mookid

Can it be extended to stop highlighting at character boundary?

It would make less distractions when comparing hexdumps of binaries: https://asciinema.org/a/470116

sskras avatar Feb 19 '22 08:02 sskras

@sskras great demo!

let's reopen and see if anyone is up to the task.

mookid avatar Feb 19 '22 23:02 mookid

Thanks.

It sounded a bit like I will need to learn Rust a bit, though=) The idea would be to add some new CLI switch for that.

sskras avatar Feb 19 '22 23:02 sskras