diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index 3ab77a578ff..846b0ffdd2c 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -190,6 +190,10 @@ static RefPtr create_find_window(VT::TerminalWidget& terminal) find_backwards.click(); }; + find_textbox.on_shift_return_pressed = [&]() { + find_forwards.click(); + }; + auto& match_case = search.add("Case sensitive"); auto& wrap_around = search.add("Wrap around"); diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index aefaa338bde..d6ab1690d20 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -731,6 +731,12 @@ void TextEditor::keydown_event(KeyEvent& event) if (event.key() == KeyCode::Key_Tab) return AbstractScrollableWidget::keydown_event(event); + if (event.modifiers() == KeyModifier::Mod_Shift && event.key() == KeyCode::Key_Return) { + if (on_shift_return_pressed) + on_shift_return_pressed(); + return; + } + if (event.key() == KeyCode::Key_Return) { if (on_return_pressed) on_return_pressed(); diff --git a/Userland/Libraries/LibGUI/TextEditor.h b/Userland/Libraries/LibGUI/TextEditor.h index c158198fa22..72f6a46b5af 100644 --- a/Userland/Libraries/LibGUI/TextEditor.h +++ b/Userland/Libraries/LibGUI/TextEditor.h @@ -138,6 +138,7 @@ public: Function on_modified_change; Function on_mousedown; Function on_return_pressed; + Function on_shift_return_pressed; Function on_escape_pressed; Function on_up_pressed; Function on_down_pressed;