Skip to content

Fixed wrapping function when text length = maxchars #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 22, 2020

Conversation

makermelissa
Copy link
Collaborator

Fixes #104. This now works on short text when the max_chars is equal to the text words.

@makermelissa makermelissa requested a review from a team December 17, 2020 18:14
@FoamyGuy
Copy link
Contributor

Thanks for this fix, I will test this out tonight.

@FoamyGuy
Copy link
Contributor

I think we still have some kind of issue here. This line no longer throws an exception but it's also dropping the entire first word:

>>> print(wrap_text_to_lines("Hello World!", 5))
['Worl-', 'd!']

@makermelissa
Copy link
Collaborator Author

Ok, I made a small adjustment. It seems the Hello World was more of an edge case and I adjusted for that.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you!

@FoamyGuy FoamyGuy merged commit 8717242 into adafruit:master Dec 22, 2020
@makermelissa
Copy link
Collaborator Author

Thanks @FoamyGuy

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

str index out of range for wrap_text_to_lines
2 participants