Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

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

Thorsten Ball4300ef840b8c
diff --git a/crates/zeta/src/zeta.rs b/crates/zeta/src/zeta.rs
index a1b171304e1..0e94e4fb915 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<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;