pub fn diff_lines(saved: &[u8], current: &[u8]) -> LineDiffExpand description
Compare two byte slices line by line and return which lines in current differ from saved.
This uses the classic LCS (Longest Common Subsequence) algorithm which is the
foundation of most diff tools including Unix diff. The algorithm:
- Find the longest common subsequence of lines between saved and current
- Lines in current not in the LCS are insertions/modifications
- Lines in saved not in the LCS represent deletions (marked at deletion point)
This correctly handles insertions, deletions, and modifications without incorrectly marking shifted lines as changed.