Skip to main content

render_cached_lines

Function render_cached_lines 

Source
pub fn render_cached_lines<'a>(
    cached_lines: &'a [CachedDiffLine],
    start_index: usize,
    selected_line: usize,
) -> Vec<Line<'a>>
Expand description

Convert cached diff lines to renderable Lines using zero-copy borrowing.

Borrows span content from the cache (Cow::Borrowed) instead of cloning, avoiding heap allocations entirely.

  • cached_lines – slice of cached lines to render (may be a sub-range).
  • start_index – absolute index of the first element in cached_lines, used to correctly identify the selected line.
  • selected_line – absolute index of the currently selected line.