Skip to main content

histogram_hunks

Function histogram_hunks 

Source
pub fn histogram_hunks(
    old: &str,
    new: &str,
    file_path: &str,
    context: u32,
    indent_heuristic: bool,
) -> Vec<Hunk>
Expand description

Line hunks of old vs new computed by imara-diff’s histogram algorithm, grouped with context unchanged lines around each change the way git itself merges nearby hunks together (mirrors imara-diff’s own unified_diff grouping rule, without needing its text printer). file_path seeds the hunk ids the same way crate::git does, so staging can find the hunk it shows regardless of which algorithm produced it, as long as both read the current algorithm.