Skip to main content

Module diff_render

Module diff_render 

Source
Expand description

Diff preview renderer — native ratatui Line/Span output.

Takes structured DiffPreview data from koda-core and produces Vec<Line<'static>> with:

  • Proper unified diff with hunk headers and context lines
  • Syntax highlighting with cross-hunk context (via pre-highlighted files)
  • Dark background tint for diff lines (red removed, green added)
  • Gutter metadata for NoSelect copy support

Constants§

GUTTER_WIDTH
Width of the gutter: 4-digit line number + space + sigil + space = 7. Used by NoSelect to know how many leading columns to skip on copy.

Functions§

render_lines
Render a DiffPreview as native ratatui Lines.