Skip to main content

Module diff

Module diff 

Source
Expand description

Structural diffs between two versions of the same resource.

Items in a resource keep their identity across every edit, so two versions align by id rather than by fuzzy content matching: align pairs the items both versions hold and names the ones only one side has. Text within a paired item diffs by character (text_runs).

Structs§

TextRun

Enums§

RunOp
The kind of a TextRun.
Step
One step of an alignment of two keyed sequences, in reading order.

Functions§

align
Align two sequences of item ids: the longest run of ids both keep in the same order is Step::Both, the rest is removed or added. Between two kept ids, the removed ones come first.
text_runs
Character-level diff of two texts into Equal/Insert/Delete runs: the common start and end are equal, the span between them aligns by longest common subsequence (or, past a size cap, is replaced whole).