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

Emoji with emoji presentation modifiers ignored #12435

Closed
christianparpart opened this issue Jun 4, 2020 · 2 comments
Closed

Emoji with emoji presentation modifiers ignored #12435

christianparpart opened this issue Jun 4, 2020 · 2 comments
Labels
bug issues reporting wrong behavior unicode 💩 (multibyte) unicode characters

Comments

@christianparpart
Copy link

christianparpart commented Jun 4, 2020

Unicode symbols have a default emoji presentation style, such as either text presentation or emoji presentation
In text presentation, those "symbols" usually take up one grid cell, so wcwidth == 1 (narrow characters), but for emoji presentation, such symbols usually take up 2 grid cells (wide characters, in terms of east-asian width properties)

So emojis in emoji presentation style should be rendered inside two cells, and the cursor should be expected not on the next, but on the next after that column.

U+009C has default presentation style Text, but U+009C U+FE0F enforces this emoji to be displayed in emoji presentation mode, hence 2 cells.

I also noticed that on other symbols, such as

So I think all emoji presentation modifiers in (neo)vim are ignored.

On the other side, an emoji with default presentation style "emoji" can be forced to be displayed in text presentation mode using the modifier U+FE0E, such as

  • U+1F600 - with default presentation style emoji, so double-width character
  • U+1F600 U+FE0E - forcing presentation style text, so single-width character.
  • nvim --version: latest master from 2 days ago
  • Operating system/version: Ubuntu 20.04
  • Terminal name/version: gnome-terminal and konsole from distribution version.
  • $TERM: xterm-256color

NB: with regards to terminal emulators, they mostly behave differently when it comes to complex unicode codepoints.

Steps to reproduce using nvim -u NORC

I used set colorcolumn=80 to see if that vertical bar is rendered correctly.
Open a file that in a few line contains latin text, and in another line some double-width emoji.
Actually it can also be seen if you use coc.nvim plugin that shows some emoji symbols for error and warning diagnostics on the left bar, then the colorcolumn will not look straight anymore.

Actual behaviour

vertical bar from colorcolumn is off by >=1 for any line that contains double-width symbols in emoji presentation.

Expected behaviour

to be straight everywhere

@christianparpart christianparpart added the bug issues reporting wrong behavior label Jun 4, 2020
@zapling
Copy link
Sponsor

zapling commented Jul 1, 2020

I'm having a very similar issue but I also get some weird line rendering behavior

Screenshot_2020-07-01_15-55-51

I added an comment of my findings here #7151 (comment)

@zeertzjq
Copy link
Member

Either fixed by #19686 or duplicate of #7151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior unicode 💩 (multibyte) unicode characters
Projects
None yet
Development

No branches or pull requests

3 participants