diff options
author | Kitty Barnett <develop@catznip.com> | 2022-11-02 19:05:24 +0100 |
---|---|---|
committer | Kitty Barnett <develop@catznip.com> | 2022-11-02 19:08:02 +0100 |
commit | c40d3351d511b19f4468f7467be38499bf16588f (patch) | |
tree | 8b3e6827e2d83498c886e446de14a780c2fcbfeb /indra/llui/llemojihelper.cpp | |
parent | d1dbefc09b77990563d22aaf08d0c5708cc6cbbe (diff) |
Commit immediately if the user already typed a full shortcode
Diffstat (limited to 'indra/llui/llemojihelper.cpp')
-rw-r--r-- | indra/llui/llemojihelper.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/llui/llemojihelper.cpp b/indra/llui/llemojihelper.cpp index 551f0331e7..32471e59a8 100644 --- a/indra/llui/llemojihelper.cpp +++ b/indra/llui/llemojihelper.cpp @@ -83,6 +83,14 @@ bool LLEmojiHelper::isCursorInEmojiCode(const LLWString& wtext, S32 cursorPos, S void LLEmojiHelper::showHelper(LLUICtrl* hostctrl_p, S32 local_x, S32 local_y, const std::string& short_code, std::function<void(LLWString)> cb) { + // Commit immediately if the user already typed a full shortcode + if (const auto* emojiDescrp = LLEmojiDictionary::instance().getDescriptorFromShortCode(short_code)) + { + cb(LLWString(1, emojiDescrp->Character)); + hideHelper(); + return; + } + if (mHelperHandle.isDead()) { LLFloater* pHelperFloater = LLFloaterReg::getInstance(DEFAULT_EMOJI_HELPER_FLOATER); |