Repository navigation
Use width aware slice - #684
Merged
Merged
Conversation
Contributor
Author
|
Sorry, my bad: Some of the tests fail with the git version of curtsies too. Going to fix it tomorrow. |
sebastinas
reviewed
May 12, 2017
| range(0, msg.width, columns), | ||
| range(columns, msg.width + columns, columns))] | ||
| if msg else ([''] if blank_line else [])) | ||
| except ValueError: |
Contributor
There was a problem hiding this comment.
In which case do we get a ValueError here?
Contributor
Author
There was a problem hiding this comment.
When attempting to get the width of a FmtStr, curtsies raises a ValueError, in case the length of the string is greater than 0, but the width of the FmtStr is less than 1.
https://raw.githubusercontent.com/thomasballinger/curtsies/master/curtsies/formatstring.py
At line 85.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #670.
May not work with the last curtsies release, tested with the git version.
Although, I'm not sure if converting to FmtStr is the most efficient way of splitting lines, but curtsies.formatstring.width_aware_slice was not working as I've expected.