Merge pull request #5019 from cubicvoid/empty-escape-fix

Make sure raw_words is nonempty before accessing its first element
This commit is contained in:
Adrian Sampson 2023-12-03 10:39:53 -05:00 committed by GitHub
commit 951b0f5763
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -858,7 +858,7 @@ def split_into_lines(string, width_tuple):
m.group("esc") + raw_word + RESET_COLOR
for raw_word in raw_words
]
else:
elif raw_words:
# Pretext stops mid-word
if m.group("esc") != RESET_COLOR:
# Add the rest of the current word, with a reset after it