Fix infinite focus transfer loop in project diagnostics

Co-authored-by: Kay Simmons <kay@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-11-03 17:52:58 -07:00
parent 05389dc239
commit 6076a3fc61

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