gerrit/gerrit-prettify/src/main/java/com
Shawn O. Pearce 7dafe19aee Highlight line-level (aka word) differences in files
We now highlight any changed words within a line replace edit,
making the actual changes stand out against the surrounding context
that makes up the line.

The highlight is computed by constructing a string that covers the
entire replaced region and then running the Myers diff algorithm
over the individual characters of those two regions.

To avoid tiny edits interleaved at every other character in a
sentance we combine two neighboring character edits together if
there are only 1 or 2 characters between them.  There are probably
many ways to improve on this algorithm to avoid some nasty corner
display cases, but this rule is good enough for now.

The highlight data is computed and stored as part of the diff cache,
which requires a schema change in this commit.  So existing diff
cache records will be flushed on the next server start, and they
will be recomputed on demand.

Bug: issue 169
Change-Id: I69142ebef600e8c3c65821272dad3ee04a497654
Signed-off-by: Shawn O. Pearce <sop@google.com>
2010-01-30 19:58:15 -08:00
..
google/gerrit/prettify Highlight line-level (aka word) differences in files 2010-01-30 19:58:15 -08:00