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

Add default syntax mapping to CSS theme in TextArea #4149

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

darrenburns
Copy link
Member

Copies the syntax highlighting from the dark VSCode theme in to the default CSS theme.

So now, if you set the language parameter on the plain TextArea (not using code_editor), you'll get some highlighting:

image

Previously, since there was no syntax highlighting style mapping, tree-sitter was parsing the file but there was no visual indication of that.

This was created with TextArea(text=TEXT, language="markdown") (and line numbers enabled).

@@ -1032,6 +1017,21 @@ def render_line(self, widget_y: int) -> Strip:
else:
line.stylize(selection_style, end=line_character_count)

highlights = self._highlights
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reordering the style sandwich ingredients here, no actual change to the code that is inside the diff.

@darrenburns darrenburns marked this pull request as ready for review February 11, 2024 20:54
Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐍🚀

@darrenburns darrenburns merged commit db4760b into main Feb 12, 2024
20 checks passed
@darrenburns darrenburns deleted the text-area-default-theme-improvement branch February 12, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants