Cannot use the :+1 emoji shortcode

meow-7.2.2
Kitty Barnett 2022-10-23 17:55:13 +02:00
parent cb0bb91108
commit fb1553d8cf
1 changed files with 12 additions and 2 deletions

View File

@ -59,8 +59,18 @@ bool LLEmojiHelper::isCursorInEmojiCode(const LLWString& wtext, S32 cursorPos, S
{
S32 shortCodePos = cursorPos;
while (shortCodePos > 1 &&
(LLStringOps::isAlnum(wtext[shortCodePos - 1]) || wtext[shortCodePos - 1] == L'-' || wtext[shortCodePos - 1] == L'_') )
auto isPartOfShortcode = [](llwchar ch) {
switch (ch)
{
case L'-':
case L'_':
case L'+':
return true;
default:
return LLStringOps::isAlnum(ch);
}
};
while (shortCodePos > 1 && isPartOfShortcode(wtext[shortCodePos - 1]))
{
shortCodePos--;
}