diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index eb8608a3ef8b2a4a24251e76d469512cd356c4b9..b823d0fd2e43643001a2c6417bf12aae85d34057 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -536,10 +536,10 @@ impl ProjectSearchView { } else { let theme = &self.settings.borrow().theme.search; self.results_editor.update(cx, |editor, cx| { - editor.highlight_ranges::(match_ranges, theme.match_background, cx); if reset_selections { - editor.select_ranges([0..0], Some(Autoscroll::Fit), cx); + editor.select_ranges(match_ranges.first().cloned(), Some(Autoscroll::Fit), cx); } + editor.highlight_ranges::(match_ranges, theme.match_background, cx); }); if self.query_editor.is_focused(cx) { self.focus_results_editor(cx);