Skip to content

Commit

Permalink
span repr
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Oct 30, 2024
1 parent c0be2a4 commit 310e208
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/textual/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ class Span(NamedTuple):
end: int
style: Style

def __rich_repr__(self) -> rich.repr.Result:
yield self.start
yield self.end
yield "style", self.style

def extend(self, cells: int) -> "Span":
"""Extend the span by the given number of cells.
Expand Down Expand Up @@ -780,7 +785,7 @@ def highlight_regex(
"will", Style(background=Color.parse("rgba(255, 255, 20, 0.3)"))
)

lines = content.wrap(40, justify="center")
lines = content.wrap(40, justify="full")
print(lines)
print("x" * 40)
for line in lines:
Expand Down

0 comments on commit 310e208

Please sign in to comment.