Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/textual/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,13 @@ def add_spans(self, spans: Sequence[Span]) -> Content:
)
return self

def draws_like(self, other: Content) -> bool:
"""Whether both draw the same: the same text with the same styled spans.

Equality compares text only, for sorting; a changed style or link is a change on screen.
"""
return self.plain == other.plain and list(self._spans) == list(other._spans)

def __eq__(self, other: object) -> bool:
"""Compares text only, so that markup doesn't effect sorting."""
if isinstance(other, str):
Expand Down
Loading