zeta: Use word-wise diff when computing edits (#21810)

Thorsten Ball , Antonio , and Bennet created

Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>

Change summary

crates/zeta/src/zeta.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

crates/zeta/src/zeta.rs 🔗

@@ -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;