feat(highlight): add MdRenderInlineCode bg to distinguish code from headings#14
Merged
Conversation
…m headings Backtick-wrapped inline code was hardcoded to the `String` highlight group. In many colorschemes `String` and the lower-level heading groups (H3+) end up with the same green-ish foreground, making `code` text indistinguishable from headings in the rendered buffer. Introduce a dedicated `MdRenderInlineCode` group: - fg: inherits from `String` so the existing color cue is preserved - bg: subtle neutral tint (Comment fg blended with Normal/NormalFloat bg at 0.18) — same pattern as `MdRenderImagePlaceholder`, mirroring how source-buffer treesitter highlights inline code Both backtick spans (`restore_code_spans`) and HTML `<code>` tags (`HTML_TAG_HIGHLIGHTS`) route through the new group. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MdRenderInlineCodehighlight group: fg followsString(preserves the existing color cue) and bg is a subtle neutral tint (Comment fg blended with Normal/NormalFloat bg at α=0.18, same pattern asMdRenderImagePlaceholder).<code>tags now use it, fixing the case where inline code was visually indistinguishable from H3+ headings in colorschemes that paint both green.Reported visually via
:vert MdRender splitwhere backtick-wrapped strings (e.g.`"fade"`) shared the same color as### Animation Types.Test plan
make test(515 passed, 0 failed; 1 assertion updated inmarkdown_checkbox_test.lua)MdRenderInlineCoderesolves tofg=#a6e3a1 bg=#2c2d3e(Normal#1e1e2eblended with Comment#6c7086at 0.18) — clearly distinct from the heading fg🤖 Generated with Claude Code