Skip to content

Commit

Permalink
Copy on write to Rich log if deferring and content is Text instance
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Sep 11, 2024
1 parent e92ca52 commit a2fc4b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/textual/widgets/_rich_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ def write(
if not self._size_known:
# We don't know the size yet, so we'll need to render this later.
# We defer ALL writes until the size is known, to ensure ordering is preserved.
if isinstance(content, Text):
content = content.copy()
self._deferred_renders.append(
DeferredRender(content, width, expand, shrink, scroll_end)
)
Expand Down

0 comments on commit a2fc4b1

Please sign in to comment.