Skip to content

Commit

Permalink
zeta: Use word-wise diff when computing edits (#21810)
Browse files Browse the repository at this point in the history
Release Notes:

- N/A

Co-authored-by: Antonio <[email protected]>
Co-authored-by: Bennet <[email protected]>
  • Loading branch information
3 people authored Dec 10, 2024
1 parent e0f4c01 commit 4300ef8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/zeta/src/zeta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ impl Zeta {
offset: usize,
snapshot: &BufferSnapshot,
) -> Vec<(Range<Anchor>, String)> {
let diff = similar::TextDiff::from_chars(old_text.as_str(), new_text);
let diff = similar::TextDiff::from_words(old_text.as_str(), new_text);

let mut edits: Vec<(Range<usize>, String)> = Vec::new();
let mut old_start = offset;
Expand Down

0 comments on commit 4300ef8

Please sign in to comment.