diff --git a/crates/diagnostics/src/diagnostics.rs b/crates/diagnostics/src/diagnostics.rs index 4409fa17ad..015339e4d3 100644 --- a/crates/diagnostics/src/diagnostics.rs +++ b/crates/diagnostics/src/diagnostics.rs @@ -100,7 +100,7 @@ impl View for ProjectDiagnosticsEditor { } fn focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext) { - if !self.path_states.is_empty() { + if cx.is_self_focused() && !self.path_states.is_empty() { cx.focus(&self.editor); } }