diff options
| author | Erik Kundiman <erik@megapahit.org> | 2026-09-01 18:35:23 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-09-04 21:58:53 +0800 |
| commit | 00bb3bb6f07660bd914d29a1389342bb3060d254 (patch) | |
| tree | 431f574922494d2201718f13085f17bc6bd7fb42 /indra/llui/lltexteditor.cpp | |
| parent | a8636720129952c10cf49ab80da21bf8b340b96c (diff) | |
| parent | 4ef9f8f14b35ed388c294d53767a0dca0e890924 (diff) | |
Merge remote-tracking branch 'secondlife/release/26.4' into 26.4
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
| -rw-r--r-- | indra/llui/lltexteditor.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 7689b93374..6588c481ff 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -61,6 +61,7 @@ #include "lltooltip.h" #include "llmenugl.h" #include "llchatmentionhelper.h" +#include "llgestureautocompletehelper.h" #include <queue> #include "llcombobox.h" @@ -1692,28 +1693,25 @@ void LLTextEditor::pasteTextWithLinebreaks(LLWString & clean_string) std::basic_string<llwchar>::size_type start = 0; std::basic_string<llwchar>::size_type pos = clean_string.find('\n',start); - while((pos != -1) && (pos != clean_string.length() -1)) + while (pos != std::basic_string<llwchar>::npos) { - if(pos!=start) + if (pos != start) { std::basic_string<llwchar> str = std::basic_string<llwchar>(clean_string,start,pos-start); setCursorPos(mCursorPos + insert(mCursorPos, str, true, LLTextSegmentPtr())); } - addLineBreakChar(true); // Add a line break and group with the next addition. + const bool trailing_linebreak = (pos == clean_string.length() - 1); + addLineBreakChar(!trailing_linebreak); start = pos+1; pos = clean_string.find('\n',start); } - if (pos != start) + if (start < clean_string.length()) { std::basic_string<llwchar> str = std::basic_string<llwchar>(clean_string,start,clean_string.length()-start); setCursorPos(mCursorPos + insert(mCursorPos, str, false, LLTextSegmentPtr())); } - else - { - addLineBreakChar(false); // Add a line break and end the grouping. - } } // copy selection to primary @@ -1950,7 +1948,8 @@ bool LLTextEditor::handleKeyHere(KEY key, MASK mask ) // not handled and let the parent take care of field movement. if (KEY_TAB == key && mTabsToNextField) { - return mShowChatMentionPicker && LLChatMentionHelper::instance().handleKey(this, key, mask); + return (mShowChatMentionPicker && LLChatMentionHelper::instance().handleKey(this, key, mask)) + || LLGestureAutocompleteHelper::instance().handleKey(this, key, mask); } if (mReadOnly && mScroller) @@ -1964,7 +1963,8 @@ bool LLTextEditor::handleKeyHere(KEY key, MASK mask ) if (!mReadOnly) { if ((mShowEmojiHelper && LLEmojiHelper::instance().handleKey(this, key, mask)) || - (mShowChatMentionPicker && LLChatMentionHelper::instance().handleKey(this, key, mask))) + (mShowChatMentionPicker && LLChatMentionHelper::instance().handleKey(this, key, mask)) || + LLGestureAutocompleteHelper::instance().handleKey(this, key, mask)) { return true; } |
