From a7e84c918da94fde58e99e0770dfd90db14739a9 Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Wed, 25 Sep 2024 18:10:00 +0200 Subject: Restore currently entered text in chat entry textbox after going through history with Ctrl-PgUp/PgDown (#2680) --- indra/llui/llchatentry.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/llui/llchatentry.cpp') diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index da5afd0386..e8d942b8af 100644 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -45,7 +45,8 @@ LLChatEntry::LLChatEntry(const Params& p) mExpandLinesCount(p.expand_lines_count), mPrevLinesCount(0), mSingleLineMode(false), - mPrevExpandedLineCount(S32_MAX) + mPrevExpandedLineCount(S32_MAX), + mCurrentInput("") { // Initialize current history line iterator mCurrentHistoryLine = mLineHistory.begin(); @@ -189,6 +190,7 @@ bool LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) { needsReflow(); } + mCurrentInput = ""; break; case KEY_UP: @@ -196,6 +198,11 @@ bool LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) { if (!mLineHistory.empty() && mCurrentHistoryLine > mLineHistory.begin()) { + if (mCurrentHistoryLine == mLineHistory.end()) + { + mCurrentInput = getText(); + } + setText(*(--mCurrentHistoryLine)); endOfDoc(); } @@ -210,16 +217,15 @@ bool LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) case KEY_DOWN: if (mHasHistory && MASK_CONTROL == mask) { - if (!mLineHistory.empty() && mCurrentHistoryLine < (mLineHistory.end() - 1) ) + if (!mLineHistory.empty() && mCurrentHistoryLine < (mLineHistory.end() - 1)) { setText(*(++mCurrentHistoryLine)); endOfDoc(); } - else if (!mLineHistory.empty() && mCurrentHistoryLine == (mLineHistory.end() - 1) ) + else if (!mLineHistory.empty() && mCurrentHistoryLine == (mLineHistory.end() - 1)) { mCurrentHistoryLine++; - std::string empty(""); - setText(empty); + setText(mCurrentInput); needsReflow(); endOfDoc(); } -- cgit v1.2.3 From 3e46d707a243e91046b3ab0af8f844d7f40f77b4 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 18 Apr 2025 17:48:02 +0300 Subject: #3758 initial chat mention support --- indra/llui/llchatentry.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'indra/llui/llchatentry.cpp') diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index da5afd0386..55e4beafb6 100644 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -51,6 +51,7 @@ LLChatEntry::LLChatEntry(const Params& p) mCurrentHistoryLine = mLineHistory.begin(); mAutoIndent = false; + mShowChatMentionPicker = true; keepSelectionOnReturn(true); } @@ -249,3 +250,21 @@ void LLChatEntry::enableSingleLineMode(bool single_line_mode) mPrevLinesCount = -1; setWordWrap(!single_line_mode); } + +LLWString LLChatEntry::getConvertedText() const +{ + LLWString text = getWText(); + S32 diff = 0; + for (auto segment : mSegments) + { + if (segment && segment->getStyle() && segment->getStyle()->getDrawHighlightBg()) + { + S32 seg_length = segment->getEnd() - segment->getStart(); + std::string slurl = segment->getStyle()->getLinkHREF(); + + text.replace(segment->getStart() + diff, seg_length, utf8str_to_wstring(slurl)); + diff += (S32)slurl.size() - seg_length; + } + } + return text; +} -- cgit v1.2.3 From da2234a563c9dfca0ce80371167ceef08300de53 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 23 Apr 2025 17:36:50 +0300 Subject: #3952 insert @ name at the cursor position --- indra/llui/llchatentry.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'indra/llui/llchatentry.cpp') diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index 55e4beafb6..b01a8caf1f 100644 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -250,21 +250,3 @@ void LLChatEntry::enableSingleLineMode(bool single_line_mode) mPrevLinesCount = -1; setWordWrap(!single_line_mode); } - -LLWString LLChatEntry::getConvertedText() const -{ - LLWString text = getWText(); - S32 diff = 0; - for (auto segment : mSegments) - { - if (segment && segment->getStyle() && segment->getStyle()->getDrawHighlightBg()) - { - S32 seg_length = segment->getEnd() - segment->getStart(); - std::string slurl = segment->getStyle()->getLinkHREF(); - - text.replace(segment->getStart() + diff, seg_length, utf8str_to_wstring(slurl)); - diff += (S32)slurl.size() - seg_length; - } - } - return text; -} -- cgit v1.2.3