diff --git a/rich/containers.py b/rich/containers.py index 4a8c26db..4ef865a2 100644 --- a/rich/containers.py +++ b/rich/containers.py @@ -153,11 +153,8 @@ class Lines: ): tokens.append(word) if index < len(spaces): - if next_word is None: - space_style = Style.null() - else: - style = word.get_style_at_offset(console, -1) - next_style = next_word.get_style_at_offset(console, 0) - space_style = style if style == next_style else line.style + style = word.get_style_at_offset(console, -1) + next_style = next_word.get_style_at_offset(console, 0) + space_style = style if style == next_style else line.style tokens.append(Text(" " * spaces[index], style=space_style)) self[line_index] = Text("").join(tokens)