Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Omitting TextArea theme doesn't highlight #4147

Closed
davidbrochart opened this issue Feb 11, 2024 · 0 comments
Closed

Omitting TextArea theme doesn't highlight #4147

davidbrochart opened this issue Feb 11, 2024 · 0 comments

Comments

@davidbrochart
Copy link
Contributor

It seems that passing a theme to a TextArea is mandatory to get syntax highlighting, is it intended?

from textual.app import App, ComposeResult
from textual.widgets import TextArea

TEXT = """\
def hello(name):
    print("hello" + name)

def goodbye(name):
    print("goodbye" + name)
"""


class TextAreaExample(App):
    def compose(self) -> ComposeResult:
        # doesn't highlight
        yield TextArea(TEXT, language="python")
        # does highlight
        yield TextArea(TEXT, language="python", theme="monokai")


app = TextAreaExample()
if __name__ == "__main__":
    app.run()

image

Textual Diagnostics

Versions

Name Value
Textual 0.50.1
Rich 13.7.0

Python

Name Value
Version 3.12.1
Implementation CPython
Compiler GCC 12.3.0
Executable /home/david/.local/share/hatch/env/virtual/jpterm/-V8cnvgI/dev/bin/python

Operating System

Name Value
System Linux
Release 5.15.0-94-generic
Version #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024

Terminal

Name Value
Terminal Application Unknown
TERM xterm-256color
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=136, height=35
legacy_windows False
min_width 1
max_width 136
is_terminal True
encoding utf-8
max_height 35
justify None
overflow None
no_wrap False
highlight None
markup None
height None
@Textualize Textualize deleted a comment from github-actions bot Feb 11, 2024
@Textualize Textualize locked and limited conversation to collaborators Feb 11, 2024
@davep davep converted this issue into discussion #4148 Feb 11, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant