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.

Fix multibuffer initialization based on RHS state (#56058)

Sathwik Chirivelli675ed70f5948
diff --git a/crates/editor/src/split.rs b/crates/editor/src/split.rs
index 8f7ef224c53..39c450fb959 100644
--- a/crates/editor/src/split.rs
+++ b/crates/editor/src/split.rs
@@ -583,8 +583,13 @@ impl SplittableEditor {
};
let project = workspace.read(cx).project().clone();
+ let is_rhs_singleton = self.rhs_multibuffer.read(cx).is_singleton();
let lhs_multibuffer = cx.new(|cx| {
- let mut multibuffer = MultiBuffer::new(Capability::ReadOnly);
+ let mut multibuffer = if is_rhs_singleton {
+ MultiBuffer::without_headers(Capability::ReadOnly)
+ } else {
+ MultiBuffer::new(Capability::ReadOnly)
+ };
multibuffer.set_all_diff_hunks_expanded(cx);
multibuffer
});