Merge pull request #1853 from zed-industries/diagnostics-focus-loop

Fix infinite focus transfer loop in project diagnostics
This commit is contained in:
Max Brunsfeld 2022-11-03 18:01:14 -07:00
parent fcbef6343e
commit b9d92af31c

View file

@ -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);
}
}