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.

Fix infinite focus transfer loop in project diagnostics

Max Brunsfeld6076a3fc610e
diff --git a/crates/diagnostics/src/diagnostics.rs b/crates/diagnostics/src/diagnostics.rs
index 4409fa17ad3..015339e4d3f 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<Self>) {
- if !self.path_states.is_empty() {
+ if cx.is_self_focused() && !self.path_states.is_empty() {
cx.focus(&self.editor);
}
}