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

[BUG] Can not input multibyte properly #22

Open
skanehira opened this issue Apr 30, 2019 · 7 comments
Open

[BUG] Can not input multibyte properly #22

skanehira opened this issue Apr 30, 2019 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@skanehira
Copy link

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:

  1. run _example/demo.go
  2. input or paste multibyte like ゴリラ

Expected behavior
Multi-byte can be inserted correctly.

Screenshots
bug-gocui

Environment (please complete the following information):

Additional context
If nothing there on cursor, it will be inserted correctly

@skanehira skanehira added the bug Something isn't working label Apr 30, 2019
@mjarkk
Copy link
Member

mjarkk commented Apr 30, 2019

This is also an issue in titles: jroimartin#157 and jroimartin#134

@skanehira
Copy link
Author

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

@glvr182
Copy link
Member

glvr182 commented Jul 15, 2019

See the following issue.

@glvr182
Copy link
Member

glvr182 commented Sep 22, 2019

Also saw that termbox had an update, see this commit

@dankox
Copy link

dankox commented Nov 9, 2020

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.

@mjarkk
Copy link
Member

mjarkk commented Nov 9, 2020

I have re-written the complete text editor with also a fix for this if i can remember correctly here: #48
My idea was to merge that together with cell because it also changes some core things.

@dankox
Copy link

dankox commented Nov 10, 2020

Oh cool, that looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants