Expand description
Unified diff formatting with ANSI colors.
Provides format_colored_diff as the single canonical implementation
for rendering diff hunks with terminal colors. Previously duplicated
in vtcode-core and vtcode-ui.
Structs§
- Diff
Bundle - A diff rendered with both structured hunks and formatted text.
- 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 retained for the legacy
vtcode_commons::diffAPI. - Diff
Palette - Foreground accents and background for one diff theme.
Enums§
- Chunk
- A contiguous borrowed character-level diff chunk.
- Diff
Line Kind - The semantic role of a line inside a hunk.
- Diff
Theme - Named diff color themes with WCAG AA-checked accents.
Functions§
- compute_
diff - Compute a diff through the extracted implementation while preserving the legacy options type.
- compute_
diff_ chunks - Computes a character-level diff with adjacent chunks coalesced.
- compute_
diff_ with_ theme - Compute a structured diff bundle using the default theme-aware formatter.
- format_
colored_ diff - Format diff hunks with standard ANSI colors for terminal display.
- format_
colored_ diff_ with_ theme - Format diff hunks with the colors of a selected diff theme.
- format_
unified_ diff - Format a unified diff without ANSI color codes.