Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Don't highlight project search matches either
Conrad Irwinfac0e2dd56bf
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex e05837740d4..5404610b1da 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -1537,7 +1537,7 @@ impl Editor {self.collapse_matches = collapse_matches;}- fn range_for_match<T: std::marker::Copy>(&self, range: &Range<T>) -> Range<T> {+ pub fn range_for_match<T: std::marker::Copy>(&self, range: &Range<T>) -> Range<T> {if self.collapse_matches {return range.start..range.start;}diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rsindex 9054d9e1213..ade60a6d348 100644--- a/crates/search/src/project_search.rs+++ b/crates/search/src/project_search.rs@@ -654,6 +654,7 @@ impl ProjectSearchView {let range_to_select = match_ranges[new_index].clone();self.results_editor.update(cx, |editor, cx| {+ let range_to_select = editor.range_for_match(&range_to_select);editor.unfold_ranges([range_to_select.clone()], false, true, cx);editor.change_selections(Some(Autoscroll::fit()), cx, |s| {s.select_ranges([range_to_select])@@ -695,8 +696,12 @@ impl ProjectSearchView {let is_new_search = self.search_id != prev_search_id;self.results_editor.update(cx, |editor, cx| {if is_new_search {+ let range_to_select = match_ranges+ .first()+ .clone()+ .map(|range| editor.range_for_match(range));editor.change_selections(Some(Autoscroll::fit()), cx, |s| {- s.select_ranges(match_ranges.first().cloned())+ s.select_ranges(range_to_select)});}editor.highlight_background::<Self>(