diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-02-22 08:38:12 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-02-22 08:38:12 +0800 |
commit | 60592ae0d7a98e071e516fcac70c5bf1427f20be (patch) | |
tree | 270a0d44f14634f7519ba222bee6203d7ed4c6e8 /indra/llui/lllineeditor.cpp | |
parent | 15e0231006838044b0315c19ed6a1b67a1da8e75 (diff) |
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.
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r-- | indra/llui/lllineeditor.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 34d08b99de..f306ecd513 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1009,7 +1009,7 @@ void LLLineEditor::addChar(const llwchar uni_char) getWindow()->hideCursorUntilMouseMove(); } -void LLLineEditor::addString(char *s) +void LLLineEditor::addString(char *s, bool editing) { if (hasSelection()) deleteSelection(); @@ -1018,9 +1018,13 @@ void LLLineEditor::addString(char *s) .substr(getCursor(), 1))) return; mText.erase(getCursor(), 1); + } else if (editing) { + mText.clear(); + setCursor(0); } mText.insert(getCursor(), utf8str_to_wstring(s)); - setCursor(getCursor() + 1); + if (editing) setCursor(strlen(s)); + else setCursor(getCursor() + 1); getWindow()->hideCursorUntilMouseMove(); } @@ -1665,7 +1669,7 @@ BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char) return handled; } -BOOL LLLineEditor::handleUnicodeStringHere(char *uni_str) +BOOL LLLineEditor::handleUnicodeStringHere(char *uni_str, bool editing) { auto handled = FALSE; @@ -1674,7 +1678,7 @@ BOOL LLLineEditor::handleUnicodeStringHere(char *uni_str) handled = TRUE; LLLineEditorRollback rollback(this); - addString(uni_str); + addString(uni_str, editing); mKeystrokeTimer.reset(); deselect(); |