202_107: Fix python syntax color visibility in dark mode#2891
202_107: Fix python syntax color visibility in dark mode#2891git-lakshy wants to merge 1 commit intoMoganLab:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates TeXmacs’ Python plugin syntax-highlighting preference colors to improve readability/contrast in dark mode, and adds a short markdown note documenting the change.
Changes:
- Adjust Python syntax highlighting preference colors in
python-lang.scm(keywords/constants/strings/operators/comments, etc.). - Add a
202_107.mdwrite-up describing the motivation and the new color scheme.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| TeXmacs/plugins/python/progs/code/python-lang.scm | Updates Python syntax highlighting color preferences for better visibility (especially in dark theme). |
| 202_107.md | Adds a brief change note documenting the issue, color changes, and author/date. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ("syntax:python:keyword" "#309090" notify-python-syntax) ;; 关键字颜色 | ||
| ("syntax:python:keyword_conditional" "#309090" notify-python-syntax) ;; 条件关键字颜色 | ||
| ("syntax:python:keyword_control" "#309090" notify-python-syntax)) ;; 控制关键字颜色 No newline at end of file | ||
| ("syntax:python:none" "#999999" notify-python-syntax) ;; Neutral Gray |
There was a problem hiding this comment.
syntax:python:none is used as the fallback color when a token type isn’t recognized by encode_color (e.g. operator_decoration such as @ is not in language.cpp’s color encoding map and therefore decodes to the none color). With this change, decorators will end up #999999 (same as comments), which reduces visual distinction. Consider mapping @ to an existing encoded operator class (like operator_special) in the Python operator feature list, or extend the core color encoding/decoding to support operator_decoration so it can have an intentional color.
| ("syntax:python:none" "#999999" notify-python-syntax) ;; Neutral Gray | |
| ("syntax:python:none" "#E36209" notify-python-syntax) ;; Warm Orange (fallback/operator-like) |
| In the dark theme, the syntax of Python becomes difficult to see. | ||
|
|
||
| ### What | ||
| To imrpove visbility updated the Python syntax highlighting color scheme in `python-lang.scm`. |
There was a problem hiding this comment.
Typo/grammar: “To imrpove visbility …” should be “To improve visibility …”
| To imrpove visbility updated the Python syntax highlighting color scheme in `python-lang.scm`. | |
| To improve visibility, updated the Python syntax highlighting color scheme in `python-lang.scm`. |
Issue :
In the dark theme, the syntax of Python becomes difficult to see.
What
To imrpove visbility updated the Python syntax highlighting color scheme in
python-lang.scm.Color Changes:
Python syntax is better visible on both light and dark themes with improved contrast and visual distinction between different syntax elements.
Screenshots
Previous :

After changes :