From a134e850c1800a0dd5a40ddf714bce94ed0dc7d8 Mon Sep 17 00:00:00 2001 From: TommyTheTerrible <81168766+TommyTheTerrible@users.noreply.github.com> Date: Fri, 2 Aug 2024 06:33:00 -0400 Subject: Disable EmojiHelper if Digit before Colon (#2178) * Disable EmojiHelper if Digit before Colon Typing in times with the new emoji helper pop-up can be frustrating, so I would like to propose disabling it when there is a number before the colon. * Remove trailing space in indra/llui/llemojihelper.cpp --------- Co-authored-by: Andrey Lihatskiy --- indra/llui/llemojihelper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui/llemojihelper.cpp') diff --git a/indra/llui/llemojihelper.cpp b/indra/llui/llemojihelper.cpp index fbe313924c..b9441a9c91 100644 --- a/indra/llui/llemojihelper.cpp +++ b/indra/llui/llemojihelper.cpp @@ -76,7 +76,9 @@ bool LLEmojiHelper::isCursorInEmojiCode(const LLWString& wtext, S32 cursorPos, S shortCodePos--; } - bool isShortCode = (L':' == wtext[shortCodePos - 1]) && (cursorPos - shortCodePos >= 2); + bool isShortCode = (cursorPos - shortCodePos >= 2) && (L':' == wtext[shortCodePos - 1]); + if(isShortCode && (shortCodePos >= 2) && isdigit(wtext[shortCodePos - 2])) // Add qualifier to avoid emoji pop-up when typing times. + isShortCode = false; if (pShortCodePos) *pShortCodePos = (isShortCode) ? shortCodePos - 1 : -1; return isShortCode; -- cgit v1.2.3