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.

Update git diff base when synchronizing a guest's buffers

Antonio Scandurra95098e4f29ae
diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs
index 271d0f242b4..608abc58156 100644
--- a/crates/project/src/project.rs
+++ b/crates/project/src/project.rs
@@ -5189,20 +5189,27 @@ impl Project {
let operations = buffer.serialize_ops(Some(remote_version), cx);
let client = this.client.clone();
- let file = buffer.file().cloned();
+ if let Some(file) = buffer.file() {
+ client
+ .send(proto::UpdateBufferFile {
+ project_id,
+ buffer_id: buffer_id as u64,
+ file: Some(file.to_proto()),
+ })
+ .log_err();
+ }
+
+ client
+ .send(proto::UpdateDiffBase {
+ project_id,
+ buffer_id: buffer_id as u64,
+ diff_base: buffer.diff_base().map(Into::into),
+ })
+ .log_err();
+
cx.background()
.spawn(
async move {
- if let Some(file) = file {
- client
- .send(proto::UpdateBufferFile {
- project_id,
- buffer_id: buffer_id as u64,
- file: Some(file.to_proto()),
- })
- .log_err();
- }
-
let operations = operations.await;
for chunk in split_operations(operations) {
client