From 4300ef840b8cafcb29c5109ba3cf238db2f816ce Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Tue, 10 Dec 2024 16:05:34 +0100 Subject: [PATCH] zeta: Use word-wise diff when computing edits (#21810) Release Notes: - N/A Co-authored-by: Antonio Co-authored-by: Bennet --- crates/zeta/src/zeta.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/zeta/src/zeta.rs b/crates/zeta/src/zeta.rs index a1b171304e179351dbdf936a32d86f8b5f10f0d9..0e94e4fb915cd9bf0af7b00a69ac8d8e1bbbd68d 100644 --- a/crates/zeta/src/zeta.rs +++ b/crates/zeta/src/zeta.rs @@ -409,7 +409,7 @@ impl Zeta { offset: usize, snapshot: &BufferSnapshot, ) -> Vec<(Range, 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, String)> = Vec::new(); let mut old_start = offset;