Skip to content

Commit

Permalink
Remove base style
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Nov 2, 2024
1 parent 310e208 commit 01f5a98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/textual/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
def _justify_lines(
lines: list[Content],
width: int,
base_style: Style,
justify: "JustifyMethod" = "left",
overflow: "OverflowMethod" = "fold",
) -> list[Content]:
Expand Down Expand Up @@ -81,10 +80,7 @@ def _justify_lines(
tokens.append(word)
if index < len(spaces):
style = word.get_style_at_offset(-1)
next_style = next_word.get_style_at_offset(0)

space_style = style

tokens.append(
Content(
" " * spaces[index],
Expand Down Expand Up @@ -712,7 +708,6 @@ def wrap(
overflow: OverflowMethod = "fold",
no_wrap: bool = False,
tab_size: int = 8,
base_style: Style = Style(),
) -> list[Content]:
lines: list[Content] = []
for line in self.split(allow_blank=True):
Expand All @@ -727,7 +722,6 @@ def wrap(
new_lines = _justify_lines(
new_lines,
width,
base_style,
justify=justify,
overflow=overflow,
)
Expand Down
4 changes: 3 additions & 1 deletion src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,8 @@ def get_content_height(self, container: Size, viewport: Size, width: int) -> int
Returns:
The height of the content.
"""
if not width:
return 0
if self.is_container:
assert self.layout is not None
height = self.layout.get_content_height(
Expand All @@ -1577,7 +1579,7 @@ def get_content_height(self, container: Size, viewport: Size, width: int) -> int
if isinstance(renderable, Text):
height = (
len(
renderable.wrap(
Text(renderable.plain).wrap(
self._console,
width,
no_wrap=renderable.no_wrap,
Expand Down

0 comments on commit 01f5a98

Please sign in to comment.