Skip to main content

rehunk_file

Function rehunk_file 

Source
pub fn rehunk_file(
    file: &FileDiff,
    context: u32,
    algorithm: DiffAlgorithm,
    indent_heuristic: bool,
) -> Option<Vec<Hunk>>
Expand description

Re-diff a file’s own old/new text at context lines of surrounding context (u32::MAX for the whole file) and algorithm, yielding the hunks the diff pane would show at that context. None for binary files or when a side’s text is absent, so the caller keeps its current hunks.