build_aligned_lines

Function build_aligned_lines 

Source
pub fn build_aligned_lines(hunk: &DiffHunk) -> Vec<AlignedLinePair>
Expand description

Builds aligned line pairs from a hunk for side-by-side display.

This function takes the lines from a hunk and pairs them up so that:

  • Context lines have the same content on both sides
  • Removed lines are on the left with None on the right
  • Added lines are on the right with None on the left
  • Consecutive removes/adds are paired up when possible

§Arguments

  • hunk - The diff hunk to process

§Returns

A vector of aligned line pairs for rendering