diff options
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(); |