Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
diagnostics: Fix losing focus when activating from diagnostics view (#25517)
brian taned6bf7f161c6
diff --git a/crates/diagnostics/src/diagnostics.rs b/crates/diagnostics/src/diagnostics.rsindex 2bca1a1e47c..169946ce0e0 100644--- a/crates/diagnostics/src/diagnostics.rs+++ b/crates/diagnostics/src/diagnostics.rs@@ -311,7 +311,10 @@ impl ProjectDiagnosticsEditor {cx: &mut Context<Workspace>,) {if let Some(existing) = workspace.item_of_type::<ProjectDiagnosticsEditor>(cx) {- workspace.activate_item(&existing, true, true, window, cx);+ let is_active = workspace+ .active_item(cx)+ .is_some_and(|item| item.item_id() == existing.item_id());+ workspace.activate_item(&existing, true, !is_active, window, cx);} else {let workspace_handle = cx.entity().downgrade();