fix(backwards): backwards funbox doesn't handle complex characters (@Leonabcd123) - #8345
fix(backwards): backwards funbox doesn't handle complex characters (@Leonabcd123)#8345Leonabcd123 wants to merge 1 commit into
Conversation
|
I believe I remember |
You're correct that we're splitting by grapheme clusters, however I don't understand why |
Yes, but there's no 1 key that can produce this combination in 1 go, so without backwards we should type
Try setting the language to Arabic first p.s., for a list of key combinations that will cause issues with grapheme splitting see this p.s.2, |
I see the problem now.
The problem with this approach is that it breaks surrogate pairs (although I still made it the fallback for when |
"𐑩".split("") // splits into 2 surrogate pairs.
[..."𐑩"] // splits into 1 Unicode character.Your reproduction example uses emoji ZWJ sequences with variation selectors which are in essence 4 Unicode characters. I'd prioritize Unicode chars integrity over combining emoji's any day tbh |
Ah sorry I confused .split("") (which breaks surrogate pairs) with the spread.
Yea, that's why I chose that emoji as the reproduction, if I hadn't known about it I would've gone with the spread approach. I'd like to try and find another solution before going with the spread. |
To reproduce:
custom🏳️🌈backwardsfunbox