Skip to main content

Module diff_preview

Module diff_preview 

Source
Expand description

Shared helpers for rendering diff previews.

Layout: {sign}{line_no} │ content (single gutter) with two-level backgrounds — full-width add/del tint plus stronger word-level chips on tokens that differ from the paired opposite line.

Structs§

DiffChangeCounts
DiffDisplayLine
SideBySideRow
One rendered row in a side-by-side diff view.

Enums§

DiffDisplayKind

Functions§

annotate_word_level_diffs
Annotate word-level (intra-line) changed ranges on consecutive -/+ pairs.
count_diff_changes
diff_display_line_number_width
display_lines_from_hunks
display_lines_from_unified_diff
format_numbered_unified_diff
side_by_side_rows
Pair display lines into side-by-side rows.
word_level_changed_ranges
Compute byte ranges in old/new that are not part of a common token subsequence.

Type Aliases§

WordChangedRanges
Intra-line highlight: list of (start, end) byte ranges in a line body.