rhysd / neovim-component

<neovim-editor> WebComponent to embed Neovim to your app with great ease
https://github.com/rhysd/NyaoVim
MIT License
193 stars 18 forks source link

Width of double-width characters is wrong. #17

Closed rhysd closed 8 years ago

rhysd commented 8 years ago

It seems that width of double-width character is narrower than double width of normal character. It causes the wrong cursor position as below.

tmp

rhysd commented 8 years ago

I currently don't have any idea except for rendering text per one character to resolve this issue.

romgrk commented 8 years ago

On the same subject (I'm not opening a new issue because issues are not pretty but if you think it should be opened I'll do): When rendering double-width chars, updates don´t cover fully the area previously drawn, therefore there are “leftovers” still drawn on screen until some other update covers completely the area. Maybe doing some more rendering than what is asked by neovim could solve this.

rhysd commented 8 years ago

Yes, I think we should render text per character. I think it is not so hard and I'll try it.

rhysd commented 8 years ago

I'm working on this in issue17 branch.

And it seems to work well:

tmp

And I also added support surrogate pair characters such as '𠮟'. It seems to work well but emojis are not rendered properly. This looks a limitation of Vim.

2016-02-10 18 51 38

:dog::sweat_drops: