From 52cddaae37629a50a32d580a9b0916e2d2652bdf Mon Sep 17 00:00:00 2001
From: xdBronch <51252236+xdBronch@users.noreply.github.com>
Date: Fri, 6 Feb 2026 19:20:03 -0500
Subject: [PATCH] editor: Use buffer_font for folds and change foreground color
(#48652)
re: https://github.com/zed-industries/zed/pull/48624
using the UI font could cause a visual bug when the cursor was over the
folded text
before:
after:
changing the color is of course just opinionated but i think it looks
better and makes more sense as a placeholder
Release Notes:
- N/A
---
crates/editor/src/display_map/fold_map.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/crates/editor/src/display_map/fold_map.rs b/crates/editor/src/display_map/fold_map.rs
index 99667bf9892f9a9509c58a95bf4d39ffb44e52e2..61447c37fbedf7eafab7bac360c36349e1b76d0b 100644
--- a/crates/editor/src/display_map/fold_map.rs
+++ b/crates/editor/src/display_map/fold_map.rs
@@ -56,9 +56,13 @@ impl FoldPlaceholder {
/// Callers add children and event handlers on top.
pub fn fold_element(fold_id: FoldId, cx: &App) -> Stateful {
use gpui::{InteractiveElement as _, StatefulInteractiveElement as _, Styled as _};
- use theme::ActiveTheme as _;
+ use settings::Settings as _;
+ use theme::{ActiveTheme as _, ThemeSettings};
+ let settings = ThemeSettings::get_global(cx);
gpui::div()
.id(fold_id)
+ .font(settings.buffer_font.clone())
+ .text_color(cx.theme().colors().text_placeholder)
.bg(cx.theme().colors().ghost_element_background)
.hover(|style| style.bg(cx.theme().colors().ghost_element_hover))
.active(|style| style.bg(cx.theme().colors().ghost_element_active))