From 38c7e63af3a4264598308b6ca07119e097777a8b Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Tue, 3 Mar 2026 10:52:00 -0500 Subject: [PATCH] git: Fix commit message buffer header not being disabled after cloning commit view (#50606) Release Notes: - Fixed extraneous buffer header when splitting the commit view. --- crates/editor/src/display_map.rs | 4 ++++ crates/editor/src/display_map/block_map.rs | 2 ++ crates/editor/src/editor.rs | 2 ++ 3 files changed, 8 insertions(+) diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rs index 57b8eb8ef6c1b29cb99da3e2a4e731d0c828038e..b666557b90a3c1181404d8f09b1d50ff9f8402a9 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.rs index db7eb53b39088c6026d3d36bef636f748c80d587..2673baae84ab74b2852004320cf1d94c5ed1ed42 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>, pub(super) buffer_header_height: u32, pub(super) excerpt_header_height: u32, + pub(super) buffers_with_disabled_headers: HashSet, } 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.rs index 28d96e721257eaad898408cafba67f9f991e4909..5504305f86eb95dee000cec4099e366bbf86ffef 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 }