Merge pull request #817 from zed-industries/dynamic-editor-highlights

Store accessors for editor highlight colors not colors themselves
This commit is contained in:
Max Brunsfeld
2022-04-14 10:36:38 -07:00
committed by GitHub
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);