Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix inlay hints using status theming instead of syntax theming (#36219)

Lauren Hinchcliffe301e97646595
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index a07f8a887ac..b9fe990dcab 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -592,11 +592,22 @@ pub fn make_inlay_hints_style(cx: &mut App) -> HighlightStyle {
.inlay_hints
.show_background;
- HighlightStyle {
- color: Some(cx.theme().status().hint),
- background_color: show_background.then(|| cx.theme().status().hint_background),
- ..HighlightStyle::default()
+ let mut style = cx.theme().syntax().get("hint");
+
+ if style.color.is_none() {
+ style.color = Some(cx.theme().status().hint);
+ }
+
+ if !show_background {
+ style.background_color = None;
+ return style;
}
+
+ if style.background_color.is_none() {
+ style.background_color = Some(cx.theme().status().hint_background);
+ }
+
+ style
}
pub fn make_suggestion_styles(cx: &mut App) -> EditPredictionStyles {