Expand description
Line-based diff algorithm for comparing saved vs current buffer content.
This module provides a simple but robust diff algorithm that correctly handles insertions, deletions, and modifications. It uses a longest common subsequence (LCS) approach to identify which lines are unchanged, then marks the ranges that differ.
Structs§
- Line
Change - A range of lines with a specific change type
- Line
Diff - Result of comparing two text buffers line by line.
Enums§
- Change
Type - Type of change detected for a line range
Functions§
- diff_
lines - Compare two byte slices line by line and return which lines in
currentdiffer fromsaved. - merge_
ranges - Merge adjacent or overlapping ranges.