From e57b9e5f833f9bda499ad22d441fcd1ecd6e164c Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 19 Feb 2025 08:42:22 +0200 Subject: [PATCH] Ignore selections persistence for multi buffer editors (#25140) Follow-up of https://github.com/zed-industries/zed/pull/25083 Release Notes: - N/A --- crates/editor/src/editor.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 457296ab7cf1f0c00304a49ce0d74dbcfcef03fd..76f8de998397c0b2b85741fa5afea4fa2dab3c36 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -2203,6 +2203,7 @@ impl Editor { cx.emit(SearchEvent::ActiveMatchChanged) } if local + && self.is_singleton(cx) && WorkspaceSettings::get(None, cx).restore_on_startup != RestoreOnStartupBehavior::None { if let Some(workspace_id) = self.workspace.as_ref().and_then(|workspace| workspace.1) { @@ -15063,7 +15064,9 @@ impl Editor { window: &mut Window, cx: &mut Context, ) { - if WorkspaceSettings::get(None, cx).restore_on_startup == RestoreOnStartupBehavior::None { + if !self.is_singleton(cx) + || WorkspaceSettings::get(None, cx).restore_on_startup == RestoreOnStartupBehavior::None + { return; } let Some(selections) = DB.get_editor_selections(item_id, workspace_id).log_err() else {