mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +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:
@@ -54,7 +54,7 @@ static inline CharSize win_charsize(CSType cstype, int vcol, char *ptr, int32_t
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_ALWAYS_INLINE
|
||||
{
|
||||
if (cstype == kCharsizeFast) {
|
||||
return charsize_fast(csarg, vcol, chr);
|
||||
return charsize_fast(csarg, ptr, vcol, chr);
|
||||
} else {
|
||||
return charsize_regular(csarg, ptr, vcol, chr);
|
||||
}
|
||||
|
Reference in New Issue
Block a user