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

MultiByte characters lead to offset errors #4

Open
alemidev opened this issue Oct 16, 2024 · 1 comment
Open

MultiByte characters lead to offset errors #4

alemidev opened this issue Oct 16, 2024 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@alemidev
Copy link
Member

Inserting an emoji works correctly and sends it to remotes, but deleting it gets sent incorrectly and leads nvim out of sync. Also if we write an emoji and someone else deletes it, we get broken chars:

image

@alemidev alemidev added the bug Something isn't working label Oct 16, 2024
@alemidev alemidev changed the title Emojis behave weirdly MultiByte characters lead to offset errors Nov 17, 2024
@alemidev
Copy link
Member Author

Investigating this more in-depth, codemp indexes buffers by char (and so do most other editors), but nvim does so by byte, leading to out-of-sync insertions after multi-bytes characters in buffers.

codemp-nvim-demo-multibyte-desync.mp4

There is a charidx() builtin but requires a whole string in input

@alemidev alemidev added the help wanted Extra attention is needed label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant