-
Notifications
You must be signed in to change notification settings - Fork 124
truncate_line not handling style sequences #886
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
Conversation
…ils.truncate_line()
Codecov Report
@@ Coverage Diff @@
## master #886 +/- ##
==========================================
+ Coverage 97.42% 97.47% +0.04%
==========================================
Files 14 14
Lines 3651 3683 +32
==========================================
+ Hits 3557 3590 +33
+ Misses 94 93 -1
Continue to review full report at Codecov.
|
Added function to index all style sequences found in a string
typing.OrderedDict wasn't added until Python 3.7.2; so replace with Dict.
|
The python 3.9-dev failures on TravisCI are not our fault. They are a temporary problem with Travis due to a bug in Virtualenv which has since been fixed: https://travis-ci.community/t/python-development-versions-no-longer-include-pip-due-to-virtualenv-20-x/7180/9 |
tleonhardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good, but I'm exhausted and not at my best in terms of reviewing.
cmd2/constants.py
Outdated
| MULTILINE_TERMINATOR = ';' | ||
|
|
||
| LINE_FEED = '\n' | ||
| HORIZONTAL_ELLIPSIS = '\N{HORIZONTAL ELLIPSIS}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain how this works? Like is it filling in an ellipsis ...? If so where is that coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an escape sequence for the one-character ellipsis. (…) It's easier type than the real thing, but I will alter the code to make it clearer.
| LINE_FEED = '\n' | ||
|
|
||
| # One character ellipsis | ||
| HORIZONTAL_ELLIPSIS = '…' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this makes more sense to me now ;-)
Fixed bug where ANSI style sequences were not correctly handled in utils.truncate_line()