diff --git a/crates/find/src/project_find.rs b/crates/find/src/project_find.rs index 24db15c664fcb8c5aba886a6c18769ebd324ca2a..7bd9ee278411d3ef0c1f0db69b16aed6a2e716c5 100644 --- a/crates/find/src/project_find.rs +++ b/crates/find/src/project_find.rs @@ -186,7 +186,11 @@ impl View for ProjectFindView { } fn on_focus(&mut self, cx: &mut ViewContext) { - cx.focus(&self.query_editor); + if self.model.read(cx).highlighted_ranges.is_empty() { + cx.focus(&self.query_editor); + } else { + cx.focus(&self.results_editor); + } } } @@ -227,6 +231,14 @@ impl ItemView for ProjectFindView { true } + fn is_dirty(&self, cx: &AppContext) -> bool { + self.results_editor.read(cx).is_dirty(cx) + } + + fn has_conflict(&self, cx: &AppContext) -> bool { + self.results_editor.read(cx).has_conflict(cx) + } + fn save( &mut self, project: ModelHandle,