workspace: Add Close Multibuffers pane context menu entry (#39199)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth
2025-10-05 10:50:36 +02:00
committed by GitHub
parent eb64ca8758
commit 1a9e9c5faa
22 changed files with 332 additions and 144 deletions
+7 -7
View File
@@ -201,7 +201,7 @@ use workspace::{
CollaboratorId, Item as WorkspaceItem, ItemId, ItemNavHistory, OpenInTerminal, OpenTerminal,
RestoreOnStartupBehavior, SERIALIZATION_THROTTLE_TIME, SplitDirection, TabBarSettings, Toast,
ViewId, Workspace, WorkspaceId, WorkspaceSettings,
item::{ItemHandle, PreviewTabsSettings, SaveOptions},
item::{ItemBufferKind, ItemHandle, PreviewTabsSettings, SaveOptions},
notifications::{DetachAndPromptErr, NotificationId, NotifyTaskExt},
searchable::SearchEvent,
};
@@ -7286,7 +7286,7 @@ impl Editor {
}
pub fn supports_minimap(&self, cx: &App) -> bool {
!self.minimap_visibility.disabled() && self.is_singleton(cx)
!self.minimap_visibility.disabled() && self.buffer_kind(cx) == ItemBufferKind::Singleton
}
fn edit_predictions_enabled_in_buffer(
@@ -17952,7 +17952,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) {
if self.is_singleton(cx) {
if self.buffer_kind(cx) == ItemBufferKind::Singleton {
let selection = self.selections.newest::<Point>(cx);
let display_map = self.display_map.update(cx, |map, cx| map.snapshot(cx));
@@ -18018,7 +18018,7 @@ impl Editor {
}
pub fn fold(&mut self, _: &actions::Fold, window: &mut Window, cx: &mut Context<Self>) {
if self.is_singleton(cx) {
if self.buffer_kind(cx) == ItemBufferKind::Singleton {
let mut to_fold = Vec::new();
let display_map = self.display_map.update(cx, |map, cx| map.snapshot(cx));
let selections = self.selections.all_adjusted(cx);
@@ -18275,7 +18275,7 @@ impl Editor {
}
pub fn unfold_lines(&mut self, _: &UnfoldLines, _window: &mut Window, cx: &mut Context<Self>) {
if self.is_singleton(cx) {
if self.buffer_kind(cx) == ItemBufferKind::Singleton {
let display_map = self.display_map.update(cx, |map, cx| map.snapshot(cx));
let buffer = &display_map.buffer_snapshot;
let selections = self.selections.all::<Point>(cx);
@@ -19056,7 +19056,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) -> Option<Entity<Self>> {
(minimap_settings.minimap_enabled() && self.is_singleton(cx))
(minimap_settings.minimap_enabled() && self.buffer_kind(cx) == ItemBufferKind::Singleton)
.then(|| self.initialize_new_minimap(minimap_settings, window, cx))
}
@@ -21834,7 +21834,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Editor>,
) {
if self.is_singleton(cx)
if self.buffer_kind(cx) == ItemBufferKind::Singleton
&& !self.mode.is_minimap()
&& WorkspaceSettings::get(None, cx).restore_on_startup != RestoreOnStartupBehavior::None
{