Skip to content
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

add word wrap capability to luma.core.virtual.terminal #78

Merged
merged 24 commits into from
Apr 17, 2017

Conversation

thijstriemstra
Copy link
Collaborator

@thijstriemstra thijstriemstra commented Apr 16, 2017

Copy link
Owner

@rm-hull rm-hull left a comment

Choose a reason for hiding this comment

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

self.puts(text)
self.newline()
if self.word_wrap:
text = wrap(text, width=self.width)
Copy link
Owner

Choose a reason for hiding this comment

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

Does wrap work with ANSI color codes? Would be worth adding a test to check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've added a test but I'm not sure if it's correct, probably not and we need to ignore these ansi color definitions?

ansi_colors_wrapped

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's def not correct, 'hello world' line is missing. hmm any ideas @rm-hull?

Copy link
Owner

Choose a reason for hiding this comment

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

Hello world is missing because it has scrolled off the top. Clearly the word wrap is counting the ANSI colour code characters rather than interpreting them as zero width.

Wonder whether we need a home grown text wrapper that does take ANSI color codes into account?

Maybe just leave as-is for now.

Interestingly, it has exposed another bug (which was there before your commits) when scrolling when the background colour is not black - see the yellow bar at the bottom.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to look into the issue a bit more before merging, thanks for the feedback.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed it!

ansi_colors_wrapped

@rm-hull also used version added 0.9.0, I assume that'll be the next version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interestingly, it has exposed another bug (which was there before your commits) when scrolling when the background colour is not black - see the yellow bar at the bottom.

I've opened #79 for that issue.

@@ -37,6 +37,13 @@ API Documentation
:undoc-members:
:show-inheritance:

:mod:`luma.core.interface.serial`
"""""""""""""""""""""""
Copy link
Owner

Choose a reason for hiding this comment

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

Think the underline needs to be the same length as the title else doc generation will complain. we should probably add docgen to the toxic was task if possible

@thijstriemstra thijstriemstra merged commit 1d708b0 into master Apr 17, 2017
@thijstriemstra thijstriemstra deleted the osx-tests branch April 17, 2017 17:29
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.

Add word-wrap capability to luma.core.virtual.terminal
2 participants