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.

workspace: Do not call set_active when deserializing a dock if that dock was not visible (#27852)

Piotr Osiewicz992831ceb6e3
diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rs
index ddd509466f1..26612892ccf 100644
--- a/crates/workspace/src/dock.rs
+++ b/crates/workspace/src/dock.rs
@@ -565,7 +565,7 @@ impl Dock {
pub fn restore_state(&mut self, window: &mut Window, cx: &mut Context<Self>) -> bool {
if let Some(serialized) = self.serialized_dock.clone() {
- if let Some(active_panel) = serialized.active_panel {
+ if let Some(active_panel) = serialized.active_panel.filter(|_| serialized.visible) {
if let Some(idx) = self.panel_index_for_persistent_name(active_panel.as_str(), cx) {
self.activate_panel(idx, window, cx);
}