Skip to main content

fold_hunks

Function fold_hunks 

Source
fn fold_hunks(section: &str, caps: &mut Caps) -> (Vec<Hunk>, bool)
Expand description

Carry one section’s hunks under the per-file caps and the read’s total, answering what is carried and whether anything was cut.

A cut lands mid-hunk: the carried part keeps the hunk’s start and takes counts describing the lines it actually carries, so a renderer reads a header that matches its body.