Expand description
Bounded structured text diffs and renderer-neutral preview rows.
Structs§
- Ansi
Diff Palette - Caller-supplied foreground styles for ANSI output.
- Diff
Bundle - A diff rendered with both structured hunks and formatted text.
- Diff
Cell - One side of a semantic preview row.
- Diff
Change Counts - Aggregate addition/deletion counts retained for compatibility.
- Diff
Display Line - A semantic legacy display line.
- Diff
Document - A complete renderer-independent diff.
- Diff
Hunk - A diff hunk with old/new ranges and semantic lines.
- Diff
Line - A source line and its old/new positions.
- Diff
Options - Options controlling diff generation.
- DiffRow
- A renderer-neutral row, optionally containing paired side-by-side cells.
- Diff
Segment - One independently styled content segment.
- Diff
Stats - Aggregate statistics for a complete document.
- Intraline
Range - Intraline byte range, always aligned to UTF-8 boundaries.
- Layout
Options - Width and bounded-excerpt options for semantic layout.
- Parse
Diff Error - Error returned for malformed unified diff input.
- Side
BySide Row - One paired row in the compatibility side-by-side model.
Enums§
- Chunk
- A contiguous borrowed character-level diff chunk.
- Diff
Algorithm - Algorithms suitable for interactive diff previews.
- Diff
Display Kind - Semantic role used by legacy preview consumers.
- Diff
Layout - Requested preview layout.
- Diff
Line Kind - The semantic role of a line inside a hunk.
- Diff
RowKind - Semantic role for a renderer-neutral row.
Constants§
- DIFF_
MIN_ BODY_ WIDTH_ WITH_ GUTTER - Minimum source width retained when the unified line gutter is visible.
- DIFF_
MIN_ SIDE_ BY_ SIDE_ WIDTH - Minimum content width for the paired old/new preview.
Functions§
- annotate_
word_ level_ diffs - Adds byte-safe intraline ranges to consecutive deletion/addition groups.
- bounded_
display_ lines - Returns a bounded head/tail excerpt of semantic display lines.
- compute_
diff - Computes a structured diff and passes non-empty hunks to a formatter.
- compute_
diff_ chunks - Computes a character-level diff with adjacent chunks coalesced.
- count_
diff_ changes - Counts additions and deletions in structured hunks.
- diff_
display_ line_ number_ width - Computes the clamped line-number gutter width.
- diff_
gutter_ fits - Whether a unified diff can keep its marker, line number, and separator without starving the source body.
- diff_
gutter_ width - Width consumed by a unified diff gutter after the line-number field.
- diff_
layout_ width - Width to pass to semantic unified layout when the renderer hides its visible gutter.
- diff_
side_ by_ side_ fits - Whether a measured width can support the paired old/new preview.
- display_
lines_ from_ hunks - Converts hunks to semantic display lines and bounded intraline ranges.
- display_
lines_ from_ unified_ diff - Parses unified text into display lines, retaining metadata lines.
- format_
numbered_ unified_ diff - Formats a numbered unified diff without ANSI color.
- format_
unified_ diff - Formats a structured diff as plain unified text.
- format_
unified_ hunks - Formats precomputed hunks as plain unified text.
- layout_
display_ lines - Lays out precomputed display lines without repeating intraline analysis.
- render_
ansi_ rows - Renders semantic rows as ANSI lines.
- side_
by_ side_ rows - Pairs deletions and additions for side-by-side presentation.
- to_
ratatui_ lines - Converts semantic rows to unstyled Ratatui lines for caller styling.
- word_
level_ changed_ ranges - Computes byte-safe word-level changed ranges for a line pair.
Type Aliases§
- Word
Changed Ranges - Intra-line highlight ranges retained for compatibility.