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.

agent_ui: Use buffer font in more places (#61738)

Finn Evers3b79b56201f3
diff --git a/crates/agent_ui/src/conversation_view/thread_view.rs b/crates/agent_ui/src/conversation_view/thread_view.rs
index 004084c8e52..2f2bac1c094 100644
--- a/crates/agent_ui/src/conversation_view/thread_view.rs
+++ b/crates/agent_ui/src/conversation_view/thread_view.rs
@@ -7754,7 +7754,8 @@ impl ThreadView {
.unwrap_or(&command_source)
.to_string();
- let mut style = MarkdownStyle::themed(MarkdownFont::Agent, window, cx);
+ let mut style =
+ MarkdownStyle::themed(MarkdownFont::Agent, window, cx).with_agent_buffer_font(cx);
style.container_style.text.font_size = Some(rems_from_px(12.).into());
style.container_style.text.line_height = Some(rems_from_px(17.).into());
style.height_is_multiple_of_line_height = true;
diff --git a/crates/markdown/src/markdown.rs b/crates/markdown/src/markdown.rs
index 92921b58c30..578b8d32784 100644
--- a/crates/markdown/src/markdown.rs
+++ b/crates/markdown/src/markdown.rs
@@ -195,7 +195,7 @@ impl MarkdownStyle {
};
let code_font_family = match font {
MarkdownFont::Preview => theme_settings.markdown_preview_code_font_family().clone(),
- MarkdownFont::Agent => theme_settings.agent_ui_font_family().clone(),
+ MarkdownFont::Agent => theme_settings.agent_buffer_font_family().clone(),
MarkdownFont::Editor => theme_settings.buffer_font.family.clone(),
};
@@ -373,6 +373,15 @@ impl MarkdownStyle {
self
}
+ pub fn with_agent_buffer_font(mut self, cx: &App) -> Self {
+ let theme_settings = ThemeSettings::get_global(cx);
+ self.base_text_style.font_family = theme_settings.agent_buffer_font_family().clone();
+ self.base_text_style.font_fallbacks = theme_settings.buffer_font.fallbacks.clone();
+ self.base_text_style.font_features = theme_settings.buffer_font.features.clone();
+ self.base_text_style.font_weight = theme_settings.buffer_font.weight;
+ self
+ }
+
pub fn with_muted_text(mut self, cx: &App) -> Self {
let colors = cx.theme().colors();
self.base_text_style.color = colors.text_muted;