-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Wrapping strings with multiple ascii color styling segements mangles string contents #4
Comments
Hi Artur, Thanks for using tty gems! It would be really sweet if you had time to work on fixing this bug in This is really cool that you're building a console game! Are you planning to open source it? I'd like to see how you're using tty libraries and generally coding the game. I'm currently working on a console game myself, which is the reason why I've created |
Yes, I am going to outsource it, it is my masters degree thesis, actually. It may be a bit hard to resolve the issue with plain strings, maybe udecorated versions would fit more into the essence of the issue of printing decorated strings inside the box. |
Describe the problem
This library(and the whole tty ecosystem) is awesome and I really like it, although I found a cornercase that also pollutes tty-box library of yours. I tried to use pastel colored strings inside the box and it failed with an error because it would not correctly process them. I will submit another issue and PR for tty-box on that problem. After I patched the problem with tty-box, I found that there was another problem lying in strings library. Strings that have multiple ascii color styling segments are getting trashed by Strings.wrap call, so they are displayed improperly in the box.
Why this is a valid usecase
I am using your library as a skeleton for my social simulation game-like console application. One of the parts of this application includes a console ncurses interface with a map to display current state of the world. Some of the information is better communicated to the user using color, so I'd like have an ability to color each tile independently which is now not possible.
Steps to reproduce the problem
Actual behaviour
Strings with multiple ascii color styling segments get mangled and unacceptable to use.
Expected behaviour
Strings with multiple ascii color styling segments are correctly wrapped as in the case with single segment with style encoding.
##Examples
Describe your environment
The text was updated successfully, but these errors were encountered: