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

failure wordwrap #166

Closed
EnterYourName opened this issue Sep 26, 2013 · 1 comment
Closed

failure wordwrap #166

EnterYourName opened this issue Sep 26, 2013 · 1 comment
Labels
Usability issue steps lead to undesirable outcome

Comments

@EnterYourName
Copy link

if you type something like "ababababababa...." into a multiline textbox, when it wraps onto a new line, you'll find that one letter is missing (for instance previous line ends in 'b' and new one starts in 'b' as well)

EDIT: bleh, accidentally opened this in my alt account. --@mniip

mniip referenced this issue in mniip/The-Powder-Toy Sep 28, 2013
enable colors, fix wordwrap, fix cursor being crazy about real and imaginary newlines, fix \x01 in console output, fix high cpu draw from transparent panel, add colors to console history
@mniip
Copy link
Member

mniip commented Dec 23, 2013

So I was thinking about it. My current idea is, when wordwrapping a string produce a vector of offsets into the string, at which the substrings start. The selection markers and the cursor position then will be ui::Points where Y would be the line.
For instance the string "lorem ipsum dolor\nsit amet" would wrap into {"lorem ipsum ", "dolor", "sit amet"}, i.e {0, 12, 18}, and for instance if cursor is at line 1, position 4 ((1, 4)), it would map to 12(start of 1st line) + 4(offset into the line) in the string, i.e "lorem ipsum dolo|r\nsit amet"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Usability issue steps lead to undesirable outcome
Projects
None yet
Development

No branches or pull requests

2 participants