From 4b70ee2813dc9b28b9a9deb62443d994964e26bc Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Tue, 9 Jan 2024 04:08:12 -0500 Subject: [PATCH] Allow inserting linebreaks on empty chat lines --- indra/llui/lltexteditor.cpp | 9 ++------- indra/newview/llviewerwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 3290bce9389..df92f26e74a 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1786,14 +1786,9 @@ BOOL LLTextEditor::handleSpecialKey(const KEY key, const MASK mask) } else if (mask == MASK_SHIFT) { - if( mCursorPos > 0 ) { - const LLWString& text = getWText(); - if( '\n' != text[ mCursorPos - 1 ] ) - { - addLineBreakChar(); - handled = TRUE; - } + addLineBreakChar(); + handled = TRUE; } } else diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index bd87170a773..4ca479fbc1d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3359,7 +3359,7 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask) // until all keystrokes have been entered. JC // HACK: Numeric keypad <enter> on Mac is Unicode 3 // HACK: Control-M on Windows is Unicode 13 - if ((uni_char == 13 && mask != MASK_CONTROL) + if ((uni_char == 13 && mask != MASK_CONTROL && mask != MASK_SHIFT) || (uni_char == 3 && mask == MASK_NONE) ) { if (mask != MASK_ALT) -- GitLab