diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rs index fd371e20cbf22585d1dd2640f01104dd16428750..a10a5f074c1c1922f6cdb053e7a4b37dd2230312 100644 --- a/crates/editor/src/display_map.rs +++ b/crates/editor/src/display_map.rs @@ -966,10 +966,22 @@ impl DisplaySnapshot { .and_then(|id| id.style(&editor_style.syntax)); if let Some(chunk_highlight) = chunk.highlight_style { + // For color inlays, blend the color with the editor background + let mut processed_highlight = chunk_highlight; + if chunk.is_inlay { + if let Some(inlay_color) = chunk_highlight.color { + // Only blend if the color has transparency (alpha < 1.0) + if inlay_color.a < 1.0 { + let blended_color = editor_style.background.blend(inlay_color); + processed_highlight.color = Some(blended_color); + } + } + } + if let Some(highlight_style) = highlight_style.as_mut() { - highlight_style.highlight(chunk_highlight); + highlight_style.highlight(processed_highlight); } else { - highlight_style = Some(chunk_highlight); + highlight_style = Some(processed_highlight); } }