Skip to content

Commit 7c25ab5

Browse files
committed
optimization
1 parent 33d974c commit 7c25ab5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/textual/content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ def get_optimal_width(
385385
A width in cells.
386386
387387
"""
388-
lines = self.without_spans.split("\n")
389-
return max(line.cell_length for line in lines)
388+
width = max(cell_len(line) for line in self.plain.split("\n"))
389+
return width
390390

391391
def get_height(self, rules: RulesMap, width: int) -> int:
392392
"""Get the height of the Visual if rendered at the given width.

0 commit comments

Comments
 (0)