summaryrefslogtreecommitdiff
path: root/indra/llui/llchatentry.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2025-04-18 20:44:34 +0300
committerGitHub <noreply@github.com>2025-04-18 20:44:34 +0300
commit11cd9b91a2cf3e71cb6dae0a08dff2b878163ce8 (patch)
treec5fed987eeece9706957ecb3e47559e4a89f4923 /indra/llui/llchatentry.cpp
parentd3d8513c3b5a7f25adac777d9d59896d8dbd14c0 (diff)
parent1c3ce46d34293f0e1dc5887ef98b05921af663c9 (diff)
Merge pull request #3914 from secondlife/marchcat/05-develop
develop → 2025.05 sync
Diffstat (limited to 'indra/llui/llchatentry.cpp')
-rw-r--r--indra/llui/llchatentry.cpp16
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();
}