Remove a possibly unecessary if/else

This commit is contained in:
moltenmuffins 2020-10-09 10:20:45 +08:00
parent 9f57640c48
commit f13e452f67
1 changed files with 3 additions and 6 deletions

View File

@ -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)