mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 07:58:35 +00:00
feat(mbyte): support extended grapheme clusters including more emoji
Use the grapheme break algorithm from utf8proc to support grapheme clusters from recent unicode versions. Handle variant selector VS16 turning some codepoints into double-width emoji. This means we need to use ptr2cells rather than char2cells when possible.
This commit is contained in:
@@ -3663,7 +3663,7 @@ func Test_string_reverse()
|
||||
call assert_equal('', reverse(v:_null_string))
|
||||
for [s1, s2] in [['', ''], ['a', 'a'], ['ab', 'ba'], ['abc', 'cba'],
|
||||
\ ['abcd', 'dcba'], ['«-«-»-»', '»-»-«-«'],
|
||||
\ ['🇦', '🇦'], ['🇦🇧', '🇧🇦'], ['🇦🇧🇨', '🇨🇧🇦'],
|
||||
\ ['🇦', '🇦'], ['🇦🇧', '🇦🇧'], ['🇦🇧🇨', '🇨🇦🇧'],
|
||||
\ ['🇦«🇧-🇨»🇩', '🇩»🇨-🇧«🇦']]
|
||||
call assert_equal(s2, reverse(s1))
|
||||
endfor
|
||||
|
Reference in New Issue
Block a user