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

Flag emojis are 2 characters #16447

Closed
ModProg opened this issue Nov 26, 2021 · 13 comments
Closed

Flag emojis are 2 characters #16447

ModProg opened this issue Nov 26, 2021 · 13 comments
Labels
bug issues reporting wrong behavior display redraw, layout, presentation unicode 💩 (multibyte) unicode characters

Comments

@ModProg
Copy link

ModProg commented Nov 26, 2021

Neovim version (nvim -v)

NVIM v0.6.0-dev+518-g1dbbaf89b

Vim (not Nvim) behaves the same?

partialiy, 8.2.3582

Operating system/version

arch linux

Terminal name/version

XTerm(369) or wezterm 20211125-225427-0bc43473

$TERM environment variable

xterm-256color or wezterm

Installation

AUR

How to reproduce the issue

nvim --clean
:e test
i
sometext 🇩🇪 somefurther text

Expected behavior

The last position of the cursor should be on the last t not two behind.
It should be possible to delete the flag as one character not two.

Actual behavior

last position of cursor:
grafik
deleting half the flag:
grafik

In vim it is slightly different, the extra spacing is behind the flag and the cursor is correctly positioned:
grafik

it is possible to delete half the flag in vim as well.

@ModProg ModProg added the bug issues reporting wrong behavior label Nov 26, 2021
@clason clason added unicode 💩 (multibyte) unicode characters clipboard clipboard, paste labels Nov 26, 2021
@clason
Copy link
Member

clason commented Nov 26, 2021

How do you insert these characters?

@ModProg
Copy link
Author

ModProg commented Nov 26, 2021

How do you insert these characters?

I pasted it

@erw7
Copy link
Contributor

erw7 commented Nov 26, 2021

I think the corresponding emoji is U+1F1E9+U+1F1EA from the Emoji Flag Sequence. At the moment, neovim cannot properly handle such emoji (Emoji Flag Sequence) as well as emoji modifiers, etc.

Ref. #7151, #12435.

@zeertzjq zeertzjq added display redraw, layout, presentation and removed clipboard clipboard, paste labels Nov 26, 2021
@WhyNotHugo
Copy link

How do you insert these characters?

https://github.com/hrsh7th/cmp-emoji/ works too.

@loops
Copy link

loops commented Jul 9, 2022

If anyone interested in this issue is able to test PR #19259 in order to see if it is
a reasonable solution to this problem, it'd be helpful. Especially since it isn't an
ideal fix, but just improves the situation for now, until a perfect solution emerges.

@zeertzjq
Copy link
Member

zeertzjq commented Aug 8, 2022

After #19674 this can achieve the same thing as #19259:

:call setcellwidths([[0x1f1e6, 0x1f1ff, 1]])

@zeertzjq
Copy link
Member

zeertzjq commented Aug 9, 2022

#19686 will make the behavior same as Vim, but will also make the workaround above no longer work.

@zeertzjq zeertzjq changed the title Flag emojis are 2 characters and break cursor positioning Flag emojis are 2 characters Aug 16, 2022
@tmillr

This comment was marked as resolved.

@zeertzjq

This comment was marked as resolved.

@tmillr

This comment was marked as resolved.

@WhyNotHugo
Copy link

:call setcellwidths([[0x1f1e6, 0x1f1ff, 1]])

This just resulted in different issues for me (the character eventually disappeared from screen when moving the cursor, even though it's not deleted and still in the buffer).

@MRAAGH
Copy link

MRAAGH commented Sep 23, 2022

Until the issue is fixed, I recommend using vi for the situations where flag emoji are needed. vi supports multi-character emoji fine. Just my 2 cents

@zeertzjq
Copy link
Member

This issue contains some outdated information. Closing in favor of #22014, which describes behavior in latest version.

@neovim neovim locked as resolved and limited conversation to collaborators Feb 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug issues reporting wrong behavior display redraw, layout, presentation unicode 💩 (multibyte) unicode characters
Projects
None yet
Development

No branches or pull requests

8 participants