languages: Fix C/C++ preprocessor directive highlight regression#49031
Open
chenwuji2000-cyber wants to merge 1 commit intozed-industries:mainfrom
Open
Conversation
MrSubidubi
requested changes
Feb 12, 2026
Member
MrSubidubi
left a comment
There was a problem hiding this comment.
I think we should instead fix the highlights for the builtin themes here. Eventually (hopefully soon) we can add a fallback if preproc is not defined to keyword.preproc as defined here, but for now I think just fixing builtin themes is the better path. What do you think?
PR zed-industries#48109 changed the capture name for C/C++ preprocessor directives from `@keyword.directive` to `@preproc`. While semantically correct, the builtin themes had `preproc` defined with colors nearly indistinguishable from plain text, causing `#include`, `#define`, etc. to appear unhighlighted. Update the `preproc` color in all builtin themes to match their respective `keyword` color, restoring visible highlighting for preprocessor directives. Fixes zed-industries#49024 Release Notes: - Fixed C/C++ preprocessor directives (`#include`, `#define`, etc.) appearing unhighlighted in builtin themes. Co-Authored-By: Claude <noreply@anthropic.com>
69a8574 to
974b2f2
Compare
Contributor
Contributor
Author
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
@keyword.directiveto@preproc. While semantically correct, the builtin themes hadpreprocdefined with colors nearly indistinguishable from plain text (e.g. One Dark#dce0e5ff, Ayu Dark#bfbdb6ff), making#include,#define, etc. appear unhighlighted.preproccolor in all builtin themes (and the fallback theme) to match their respectivekeywordcolor, restoring visible highlighting for preprocessor directives.Fixes #49024
Side effects
@preprocfor//go:and// +buildcompiler directives. These will also change from the previous muted gray to the keyword color. This is arguably an improvement — compiler directives are special constructs that benefit from visible highlighting, consistent with how other editors (CLion, VS Code) handle them.Test plan
cargo test -p language highlight_mappasses#include,#define,#ifdef, etc. are highlighted with the keyword color//go:directives are highlighted reasonablyRelease Notes:
#include,#define, etc.) appearing unhighlighted in builtin themes.🤖 Generated with Claude Code