Skip to content

TextArea wrapping tabs strangely with latest Rich #6351

@TomJGooding

Description

@TomJGooding

When the text in the TextArea contains tabs, the wrapping seems a bit strange after upgrading to the latest Rich (14.3.0).

Here's a simple example with before and after screenshots for comparison:

rich 14.2.0 rich 14.3.0
rich 14.2.0 rich 14.3.0
from textual.app import App, ComposeResult
from textual.widgets import TextArea

TEXT = """\
#define SHORT_NAME\t\t 0x00FF
#define LONGER_NAME\t\t 0x0F0F
#define EVEN_LONGER_NAME 0xFFFF\
"""


class TextAreaExample(App):
    CSS = """
    TextArea { 
        width: 40;
    }
    """

    def compose(self) -> ComposeResult:
        yield TextArea(TEXT, show_line_numbers=True)


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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions