zed/crates/settings/src
Lee Nussbaum 003e821177
markdown_preview: Independent code font family (#56744)
Adds a `markdown_preview_code_font_family` setting that overrides the
font used in the markdown preview for code — inline `code` spans and
fenced code blocks.
This is the counterpart to `markdown_preview_font_family` (#54003),
which already does this for body text. Together they let you choose a
typographically matched body + code font pair for the preview without
forcing the code font onto editor buffers, where it may not be a good
coding font:

```json
{
  "markdown_preview_font_family": "Noto Serif",
  "markdown_preview_code_font_family": "Noto Sans Mono"
}
```

Behavior mirrors `markdown_preview_font_family`:
- Scoped to the markdown preview only (`MarkdownFont::Preview`). The
agent panel, notifications, hover popovers, and REPL output are
unaffected — they keep using the buffer font for code.
- Falls back to the buffer font family when unset, so existing previews
are unchanged.
- Overrides the font family only; fallbacks and features still come from
the buffer font.

Before (uses buffer font, here Iosevka):

<img width="509" height="368" alt="Screenshot 2026-05-14 at 1 39 51 PM"
src="https://github.com/user-attachments/assets/6b7e49b2-fc6e-4db1-9679-392b3447f411"
/>

After (uses specified font, here Noto Sans Mono):

<img width="508" height="368" alt="Screenshot 2026-05-14 at 1 40 51 PM"
src="https://github.com/user-attachments/assets/f911c99b-08f8-4336-83eb-54b555f11c54"
/>

Release Notes:

- Added `markdown_preview_code_font_family` to override the code font in
the markdown preview
2026-05-14 20:03:29 +00:00
..
base_keymap_setting.rs Automate settings registration (#42238) 2025-11-07 22:27:14 +00:00
content_into_gpui.rs Split settings content into its own crate (#46845) 2026-01-15 18:10:21 +00:00
editable_setting_control.rs
editorconfig_store.rs settings: Improve performance for internal editorconfig resolution (#48243) 2026-02-03 11:45:45 +05:30
keymap_file.rs settings: Add auto completion to command aliases setting (#54496) 2026-04-22 15:09:09 +01:00
settings.rs Settings profile base option (#52456) 2026-04-02 00:44:53 +00:00
settings_file.rs Fix rules files not loading and config file rescan clearing tokens (#53659) 2026-04-21 08:30:31 +00:00
settings_store.rs Fix the test for non-dev test runs (#55089) 2026-04-28 14:55:26 +00:00
vscode_import.rs markdown_preview: Independent code font family (#56744) 2026-05-14 20:03:29 +00:00