Store accessors for editor highlight colors not colors themselves

This commit is contained in:
Keith Simmons
2022-04-13 15:30:57 -07:00
parent 031472dc5a
commit 292d075f81
4 changed files with 36 additions and 29 deletions
+1 -2
View File
@@ -544,10 +544,9 @@ impl BufferSearchBar {
}
}
let theme = &cx.global::<Settings>().theme.search;
editor.highlight_background::<Self>(
ranges,
theme.match_background,
|theme| theme.search.match_background,
cx,
);
});
+5 -2
View File
@@ -473,8 +473,11 @@ impl ProjectSearchView {
if reset_selections {
editor.select_ranges(match_ranges.first().cloned(), Some(Autoscroll::Fit), cx);
}
let theme = &cx.global::<Settings>().theme.search;
editor.highlight_background::<Self>(match_ranges, theme.match_background, cx);
editor.highlight_background::<Self>(
match_ranges,
|theme| theme.search.match_background,
cx,
);
});
if self.query_editor.is_focused(cx) {
self.focus_results_editor(cx);