-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fix how wide runes are displayed #109
Conversation
Internal cell buffer represent each rune which should be displayed. This cell buffer is translated into tcell representation in `draw`. If wide rune is presented, it will be represented in `tcell` by one cell with the rune and following with "empty" cells. Internal representation is fixed in multiple places so it's not mixed with interpreting rune width. This fixes also problem with `SetWritePos` function.
@mjarkk There is one more fix in this, where |
Awesome work, compared to master i can now properly edit lines with multi with terminal characters. compared to master this now seems to be fixed: pasting I still see 1 issue that's also in master, when i paste multiple |
@dankox this seems to fix the issue, I'll rebase my tables.go tweak onto it. |
@mjarkk thanks... actually I was testing this scenario and saw it fixed. And now as I looked at it, it's not 🤦♀️ |
Wide character will not be visible if the line is wrapped on it and "half" of it is on the first line and second "half" on the second line.
@mjarkk it should be fixed. Hopefully I cover your case as I'm not sure I understand it completly (maybe I did:). Now it should move correctly and display it correctly too. |
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.
Thanks that fixes the problem
This PR should fix problems with wide characters displaying and editing and also
SetWritePos
function not working correctly.Internal cell buffer represent each rune which should be displayed as a single cell.
This cell buffer is translated into tcell representation in
View.draw()
. For wide runes, it will be set as one cell with the rune and following cell would be empty (until the width of the rune).This was used before, but internal representation was using rune width in some places making it mixed and therefore creating some problems with the wide runes.
@aynakeya can you please check and test this PR for your problem? I think it should work with the wide characters now (as far as I tested). But I'm not sure what other problems you might have, so it would be helpful if you can try.
@coloursofnoise can you check if this one helps with the
SetWritePos
if you used it elsewhere? Intables.go
it should work fine.