Skip to content

Commit e66613c

Browse files
committed
Fix slow property in wrapped document.
Replaced looped calculation with simple len(...).
1 parent 65aff95 commit e66613c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/textual/document/_wrapped_document.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def lines(self) -> list[list[str]]:
151151
@property
152152
def height(self) -> int:
153153
"""The height of the wrapped document."""
154-
return sum(len(offsets) + 1 for offsets in self._wrap_offsets)
154+
return len(self._offset_to_line_info)
155155

156156
def wrap_range(
157157
self,

0 commit comments

Comments
 (0)