Skip to content

markdown_preview: Independent code font family#56744

Merged
ChristopherBiscardi merged 1 commit into
zed-industries:mainfrom
wln:markdown_preview_code_font_family
May 14, 2026
Merged

markdown_preview: Independent code font family#56744
ChristopherBiscardi merged 1 commit into
zed-industries:mainfrom
wln:markdown_preview_code_font_family

Conversation

@wln

@wln wln commented May 14, 2026

Copy link
Copy Markdown
Contributor

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:

{
  "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):

Screenshot 2026-05-14 at 1 39 51 PM

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

Screenshot 2026-05-14 at 1 40 51 PM

Release Notes:

  • Added markdown_preview_code_font_family to override the code font in the markdown preview

Add `markdown_preview_code_font_family` setting to parallel `markdown_preview_font_family`.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 14, 2026
@ChristopherBiscardi ChristopherBiscardi added the area:preview/markdown Feedback for Zed's Markdown preview label May 14, 2026
@ChristopherBiscardi ChristopherBiscardi self-assigned this May 14, 2026

@ChristopherBiscardi ChristopherBiscardi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@ChristopherBiscardi ChristopherBiscardi added this pull request to the merge queue May 14, 2026
Merged via the queue into zed-industries:main with commit 003e821 May 14, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:preview/markdown Feedback for Zed's Markdown preview cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants