Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
git: Fix commit message buffer header not being disabled after cloning commit view (#50606)
Cole Miller38c7e63af3a4
diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rsindex 57b8eb8ef6c..b666557b90a 100644--- a/crates/editor/src/display_map.rs+++ b/crates/editor/src/display_map.rs@@ -789,6 +789,9 @@ impl DisplayMap {.collect(),cx,);+ for buffer_id in &other.block_snapshot.buffers_with_disabled_headers {+ self.disable_header_for_buffer(*buffer_id, cx);+ }}/// Creates folds for the given creases.@@ -1003,6 +1006,7 @@ impl DisplayMap {&self.block_map.folded_buffers}+ #[instrument(skip_all)]pub(super) fn clear_folded_buffer(&mut self, buffer_id: language::BufferId) {self.block_map.folded_buffers.remove(&buffer_id);}diff --git a/crates/editor/src/display_map/block_map.rs b/crates/editor/src/display_map/block_map.rsindex db7eb53b390..2673baae84a 100644--- a/crates/editor/src/display_map/block_map.rs+++ b/crates/editor/src/display_map/block_map.rs@@ -78,6 +78,7 @@ pub struct BlockSnapshot {custom_blocks_by_id: TreeMap<CustomBlockId, Arc<CustomBlock>>,pub(super) buffer_header_height: u32,pub(super) excerpt_header_height: u32,+ pub(super) buffers_with_disabled_headers: HashSet<BufferId>,}impl Deref for BlockSnapshot {@@ -657,6 +658,7 @@ impl BlockMap {custom_blocks_by_id: self.custom_blocks_by_id.clone(),buffer_header_height: self.buffer_header_height,excerpt_header_height: self.excerpt_header_height,+ buffers_with_disabled_headers: self.buffers_with_disabled_headers.clone(),},}}diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex 28d96e72125..5504305f86e 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -1973,6 +1973,8 @@ impl Editor {.clone_state(&self.scroll_manager, &my_snapshot, &clone_snapshot, cx);clone.searchable = self.searchable;clone.read_only = self.read_only;+ clone.buffers_with_disabled_indent_guides =+ self.buffers_with_disabled_indent_guides.clone();clone}