Open nyaa8 opened 4 years ago
I am a newbie to Rust, so I might be wrong.
It looks like the problem is with the frontend(?) because the file looks correctly in Vim after saving in Amp.
It seems like emojis or grapheme clusters of width 2 isn't counted as such and therefor the cursor position is wrong. Look into Unicode's EastAsianWidth.txt doc on how to determine this, also need to check for VS16, amongst other things (this specification for a python wcwidth library might help) .. or use a existing library which solves these things. Similar to zigglyph
Hello! I've noticed that when placing the cursor after an emoji in Insert mode, Amp breaks a bit :/
Here is a GIF:
Amp probably gets confused with emoji's structure 😕
Some random stuff related to emoji encoding
JavaScript
🐛
The first character is called
Replacement Character
and the second one is a part ofLow Surrogates
block 🤔🍙
Again, the first one belongs to
High Surrogates
, and the second one toLow Surrogates
.Then I decided to check it in Rust:
Here is the code I used: gist.github.com/nyaascii/65eccc68c388cf21ed8b270e774d386d
Sorry and thank you for reading this 🙇