summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2022-10-23 17:55:13 +0200
committerKitty Barnett <develop@catznip.com>2022-10-23 16:29:29 +0200
commitfb1553d8cf704eeb222de7ebd520a81fa242b317 (patch)
treeaa9b003c20e6a4dcab432568ea4b3ea186933de5
parentcb0bb91108b628e1134f1f655eaca9d305961cda (diff)
Cannot use the :+1 emoji shortcode
-rw-r--r--indra/llui/llemojihelper.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/llui/llemojihelper.cpp b/indra/llui/llemojihelper.cpp
index 54c801ab7b..551f0331e7 100644
--- a/indra/llui/llemojihelper.cpp
+++ b/indra/llui/llemojihelper.cpp
@@ -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--;
}