Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
zeta2: Do not include empty edit events (#39116)
Bennet Bo Fennerb7f9fd7d74e3
diff --git a/crates/zeta2/src/zeta2.rs b/crates/zeta2/src/zeta2.rsindex f58bb963dd4..ba9b50bbf3f 100644--- a/crates/zeta2/src/zeta2.rs+++ b/crates/zeta2/src/zeta2.rs@@ -339,7 +339,7 @@ impl Zeta {state.events.iter()- .map(|event| match event {+ .filter_map(|event| match event {Event::BufferChange {old_snapshot,new_snapshot,@@ -356,15 +356,20 @@ impl Zeta {}});- predict_edits_v3::Event::BufferChange {- old_path,- path,- diff: language::unified_diff(- &old_snapshot.text(),- &new_snapshot.text(),- ),- //todo: Actually detect if this edit was predicted or not- predicted: false,+ // TODO [zeta2] move to bg?+ let diff =+ language::unified_diff(&old_snapshot.text(), &new_snapshot.text());++ if path == old_path && diff.is_empty() {+ None+ } else {+ Some(predict_edits_v3::Event::BufferChange {+ old_path,+ path,+ diff,+ //todo: Actually detect if this edit was predicted or not+ predicted: false,+ })}}})