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.

Avoid calling edits_since in apply_diff

Max Brunsfeld1deff43639f0
diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rs
index 5402709124d..5d7e4325d15 100644
--- a/crates/language/src/buffer.rs
+++ b/crates/language/src/buffer.rs
@@ -1199,7 +1199,10 @@ impl Buffer {
pub fn apply_diff(&mut self, diff: Diff, cx: &mut ModelContext<Self>) -> Option<TransactionId> {
if self.version == diff.base_version {
- self.apply_non_conflicting_portion_of_diff(diff, cx)
+ self.start_transaction();
+ self.text.set_line_ending(diff.line_ending);
+ self.edit(diff.edits, None, cx);
+ self.end_transaction(cx)
} else {
return None;
}