Skip to content

Commit

Permalink
Handle infinite line lengths (#61)
Browse files Browse the repository at this point in the history
I broke infinite lines during the rewrite. Luckily, the wrapping code is completely centralized so this one small change fixes it everywhere.
  • Loading branch information
jmholla authored Apr 18, 2022
1 parent 5354d30 commit 123d7ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion markflow/_utils/textwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def join(split_text: List[str], leading_spaces: List[bool], width: Number) -> st
potential_new_string = f"{new_split_text[-1]} {word}"
else:
potential_new_string = f"{new_split_text[-1]}{word}"
if len(potential_new_string) <= width or not new_split_text[-1]:
if len(potential_new_string) <= width or not new_split_text[-1] or width <= 0:
new_split_text[-1] = potential_new_string
else:
new_split_text.append(word)
Expand Down

0 comments on commit 123d7ea

Please sign in to comment.