From 278e66d6a943edbb2e3f181d651e2d00ea35aa3c Mon Sep 17 00:00:00 2001 From: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com> Date: Sat, 3 Jan 2026 22:39:49 +0100 Subject: [PATCH] editor: Use a default font for the minimap (#45999) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #45496 Should help #43460 And probably also #44503 The minimap usually renders about 10x more lines of code and shaped text than the editor. With expensive fonts such as Google Sans Code, this can cause noticeable lag, since we attempt to synthesize 300+ lines of code using a heavy font. Because minimap text is rendered at around 2px and is essentially illegible, it doesn’t make sense to use the custom buffer font. Release Notes: - Improved minimap performance when using custom fonts --------- Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com> --- crates/editor/src/editor.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 764b40ddb7..245d7a294e 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -20275,6 +20275,7 @@ impl Editor { cx: &mut Context, ) -> Entity { const MINIMAP_FONT_WEIGHT: gpui::FontWeight = gpui::FontWeight::BLACK; + const MINIMAP_FONT_FAMILY: SharedString = SharedString::new_static(".ZedMono"); let mut minimap = Editor::new_internal( EditorMode::Minimap { @@ -20290,6 +20291,7 @@ impl Editor { minimap.set_text_style_refinement(TextStyleRefinement { font_size: Some(MINIMAP_FONT_SIZE), font_weight: Some(MINIMAP_FONT_WEIGHT), + font_family: Some(MINIMAP_FONT_FAMILY), ..Default::default() }); minimap.update_minimap_configuration(minimap_settings, cx);