diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-04-18 21:36:56 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-18 21:36:56 +0300 |
| commit | 9a333e65c4019540d5675e72ac57ef5ab106aab0 (patch) | |
| tree | 55fa0d6d0de4521f0d8f764bb13b2e6c069602bb /indra/llui/llchatentry.cpp | |
| parent | 3d5f1541dd9980196ba0c8a3c3396c8ed3384d1e (diff) | |
| parent | 4cccf8af43c8ebd9f947b9050a0403f65d0de7ee (diff) | |
Merge develop into release/2025.04
Diffstat (limited to 'indra/llui/llchatentry.cpp')
| -rw-r--r-- | indra/llui/llchatentry.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
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(); } |
