Open skanehira opened 5 years ago
This is also an issue in titles: https://github.com/jroimartin/gocui/issues/157 and https://github.com/jroimartin/gocui/issues/134
When multi-byte inserted then width of string will checked byrunewidth.RuneWidth
.
It's seems like good work but I don't know cause this bug occured...
I'll read more code and fix this.
https://github.com/awesome-gocui/gocui/blob/master/edit.go#L61
Was checking this a bit yesterday. The problem is that cursor is moved by runewidth
width, but only one cell is inserted (so the next character is placed after another character, not next to the just inserted one).
I might look into it later, after tcell
, to see if there needs to be special handling done. When I moved by 1 cell, it seems it worked fine. But there is too much logic around it, so I'm not sure if I didn't miss something. Also I'm not sure which runes could display over the next one when they are 2+ length size. For the characters in this issue, it seems like they did not display over each other and could be in cells next to each other. Other approach would be to insert 1 more space cell.
I have re-written the complete text editor with also a fix for this if i can remember correctly here: https://github.com/awesome-gocui/gocui/pull/48
My idea was to merge that together with cell because it also changes some core things.
Oh cool, that looks good.
Describe the bug Put the cursor on the alphabet and input multi-byte it's not inserted correctly.
To Reproduce Steps to reproduce the behavior:
ゴリラ
Expected behavior Multi-byte can be inserted correctly.
Screenshots
Environment (please complete the following information):
Additional context If nothing there on cursor, it will be inserted correctly