diff options
-rw-r--r-- | indra/llui/lltexteditor.cpp | 8 | ||||
-rw-r--r-- | indra/llui/lltexteditor.h | 7 | ||||
-rw-r--r-- | indra/newview/llfloaterluadebug.cpp | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 088fbe2744..81959f1542 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1602,8 +1602,14 @@ void LLTextEditor::cleanStringForPaste(LLWString & clean_string) } } -void LLTextEditor::pasteTextWithLinebreaksImpl(const LLWString & clean_string) +void LLTextEditor::pasteTextWithLinebreaksImpl(const LLWString & clean_string, bool reset_cursor) { + if (reset_cursor) + { + deselect(); + setCursorPos(getLength()); + } + std::basic_string<llwchar>::size_type start = 0; std::basic_string<llwchar>::size_type pos = clean_string.find('\n',start); diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 32dd95b8ac..0df2f6b38a 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -308,14 +308,13 @@ private: public: template <typename STRINGTYPE> - void pasteTextWithLinebreaks(const STRINGTYPE& clean_string) + void pasteTextWithLinebreaks(const STRINGTYPE& clean_string, bool reset_cursor = false) { - pasteTextWithLinebreaksImpl(ll_convert(clean_string)); + pasteTextWithLinebreaksImpl(ll_convert(clean_string), reset_cursor); } - void pasteTextWithLinebreaksImpl(const LLWString& clean_string); + void pasteTextWithLinebreaksImpl(const LLWString& clean_string, bool reset_cursor = false); private: - void pasteTextWithLinebreaksInternal(const LLWString & clean_string); void onKeyStroke(); // Concrete TextCmd sub-classes used by the LLTextEditor base class diff --git a/indra/newview/llfloaterluadebug.cpp b/indra/newview/llfloaterluadebug.cpp index 7a7824c7e6..362a02a642 100644 --- a/indra/newview/llfloaterluadebug.cpp +++ b/indra/newview/llfloaterluadebug.cpp @@ -60,7 +60,7 @@ bool LLFloaterLUADebug::postBuild() { LLCachedControl<bool> show_source_info(gSavedSettings, "LuaDebugShowSource", false); std::string source_info = show_source_info ? data["source_info"].asString() : ""; - mResultOutput->pasteTextWithLinebreaks(stringize(data["level"].asString(), source_info, data["msg"].asString())); + mResultOutput->pasteTextWithLinebreaks(stringize(data["level"].asString(), source_info, data["msg"].asString()), true); mResultOutput->addLineBreakChar(true); return false; }); |