Expand description
Diff-based edit helpers.
Structs§
- Edit
- A single edit operation
- Edit
Diff Error - Error during diff computation
- Edit
Diff Result - Result of computing diffs for a set of edits
Enums§
- Line
Ending - Line ending type
Functions§
- apply_
edits_ to_ normalized_ content - Apply multiple edits to normalized (LF) content. Validates that edits don’t overlap, are unique, and all find matches.
- compute_
edits_ diff - Compute a unified diff between original and modified content. Returns the diff string and the first changed line number.
- detect_
line_ ending - Detect line ending type of content
- generate_
diff_ string - Generate a diff string from a set of edits applied to content
- has_bom
- Check if content starts with BOM
- normalize_
to_ lf - Normalize content to LF line endings for diff computation
- restore_
line_ endings - Restore original line endings
- strip_
bom - Strip UTF-8 BOM from content