Syntax highlighting for conditional logic if/then broken in high-contrast theme
p5.js version
2.3.3
What is your operating system?
Mac OS
Web browser and version
Chrome 153.0.8010.37 (Official Build) (arm64)
Actual Behavior
Syntax Highlighting for conditional logic is grey.
Expected Behavior
Syntax Highlighting for conditional logic turns yellow
Steps to reproduce
This seems to only affect Hi-Con mode.
Hi @bmoren and maintainers! I'd love to work on this issue.
Root Cause
In client/modules/IDE/components/Editor/utils/highlightStyle.js (line 29), tags.controlKeyword is currently mapped to class: 'cm-operator' instead of class: 'cm-keyword':
{ tag: tags.controlKeyword, class: 'cm-operator' },
@bmoren Do you mind reuploading the screenshot? It's broken on the initial description.
Just wanted to validate one more thing after the screenshot is uploaded, then @tirthraj01 you can be assigned this issue. Thanks!
EDIT: Please disregard my last comment, as it was an issue on my end. I agree, let's turn on the yellow for if statements in high contrast mode. @tirthraj01 I will assign this to you. Thanks!
@doradocodes sure!
Hi @doradocodes and @bmoren!
I've opened PR #4317 to resolve this issue:
- Mapped
tags.controlKeywordtocm-keywordinhighlightStyle.jsso conditional logic (if,else, etc.) turns yellow in high-contrast mode as expected. - Updated the corresponding documentation comments in
_editor.scss. - Verified that all TypeScript typechecks, linters, and unit tests pass cleanly.
Please feel free to review whenever you have a chance! Thank you!