Skip to main content

Module diff_view

Module diff_view 

Source
Expand description

What a diff view needs from a Diff, independent of how it draws: the ranges to mark, the filler blocks that keep two panes aligned, stepping between changes, the edit that reverts a change, and the unchanged stretches worth collapsing. Offsets are chars, lines are 0-based.

Structs§

Filler
A block of empty lines in one pane, so the panes stay aligned.

Enums§

DiffMark
What a marked range is.

Functions§

fillers
Side by side, the shorter side of each change gets the missing lines.
marks
The ranges to mark: the original’s in old, the modified text’s in new. With inline the original is not shown, so it gets no marks.
next_change
The first line of the next change after line in the modified text (or the previous one before it), wrapping around; None without changes.
revert_edit
The edit to the modified text that puts change c’s original lines back.
unchanged_regions
Unchanged stretches longer than 2 * context lines on one side (in_modified picks it), as (first, last) lines to fold, keeping context lines around each change.