Skip to main content

Module diff

Module diff 

Source
Expand description

Line and word diff for the compare view (PLAN M12), using similar.

The result is a list of aligned rows: each row shows a line of the left document, a line of the right one, or both. A missing side is a filler row, so equal text stays side by side. Each side of a compare view is an editor view whose Padding (from LineDiff::padding) puts those blank rows into its display rows.

Structs§

DiffRow
DiffStats
LineDiff

Enums§

RowKind
Side

Constants§

DIFF_TIMEOUT
Give up refining a diff after this long and report a coarser one.

Functions§

diff_lines
Aligns the lines of left and right. Replaced blocks are paired line by line as Changed; the extra lines of the longer side are Removed or Added.
diff_words
Byte ranges of the words that differ between two changed lines, on each side. Adjacent ranges are merged.