From 60592ae0d7a98e071e516fcac70c5bf1427f20be Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 22 Feb 2024 08:38:12 +0800 Subject: IME composition is now replaced by the result instead of being printed alongside. For now, it always gets reset from the start after pressing Return, which is to be fixed next. --- indra/llui/lltexteditor.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/llui/lltexteditor.cpp') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 299af0dec8..d81009246f 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1202,7 +1202,7 @@ void LLTextEditor::addChar(llwchar wc) } } -void LLTextEditor::addString(char *str) +void LLTextEditor::addString(char *str, bool editing) { if (!getEnabled()) return; @@ -1210,6 +1210,10 @@ void LLTextEditor::addString(char *str) deleteSelection(TRUE); else if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode()) removeChar(mCursorPos); + else if (editing) { + clear(); + setCursorPos(0); + } setCursorPos(mCursorPos + addString(mCursorPos, str)); @@ -1948,12 +1952,12 @@ BOOL LLTextEditor::handleUnicodeCharHere(llwchar uni_char) return handled; } -BOOL LLTextEditor::handleUnicodeStringHere(char *uni_str) +BOOL LLTextEditor::handleUnicodeStringHere(char *uni_str, bool editing) { auto handled = FALSE; if (!mReadOnly) { - addString(uni_str); + addString(uni_str, editing); getWindow()->hideCursorUntilMouseMove(); handled = TRUE; } -- cgit v1.2.3