Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make shader preprocessor keyword colors consistent #79112

Merged

Conversation

bitsawer
Copy link
Member

@bitsawer bitsawer commented Jul 6, 2023

Fixes #78799

Currently some shader preprocessor keyword colors (like #if and #else) conflict with normal shader keywords, causing some inconsistencies. The easiest way to fix these is to simply make all preprocessor keywords into control flow keywords (which most of them actually are anyway), this way all preprocessor keyword colors are consistent. Of the two imperfect color choices, this should be the better one.

The best solution would be to improve the syntax highlighter to support more comples keywords that can have symbols (like #) in them or create a custom highlighter, but that's a lot of effort for little gain.

Colors, before and after this PR. With default colors the difference was not too bad, but if you customize your keyword colors it can become confusing fast.

Before:

before

After:

after

@bitsawer bitsawer added this to the 4.2 milestone Jul 6, 2023
@bitsawer bitsawer requested a review from a team as a code owner July 6, 2023 15:23
@akien-mga akien-mga added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jul 6, 2023
@akien-mga akien-mga merged commit 4438206 into godotengine:master Jul 7, 2023
13 checks passed
@akien-mga
Copy link
Member

Thanks!

@bitsawer bitsawer deleted the fix_preprocessor_keyword_colors branch July 7, 2023 13:26
@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jul 10, 2023
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shader preprocessor #if and #else highlighted with wrong color
4 participants