summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/TextEditor.cpp
diff options
context:
space:
mode:
authorMarcus Nilsson <brainbomb@gmail.com>2021-06-02 13:21:17 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-02 18:08:56 +0200
commit11fa3e4f92325e265834c05fd1385873f2733ff8 (patch)
tree1900f3d4533053621a4612b289dadd5877107b53 /Userland/Libraries/LibGUI/TextEditor.cpp
parent9550564767c4ff5566c7277acb35d5b95cdf4e96 (diff)
downloadserenity-11fa3e4f92325e265834c05fd1385873f2733ff8.zip
Terminal/LibGUI::TextEditor: Add shift+return to search forwards
This adds support for shift+return key combo in single line TextEditor fields. Used in this case for searching backwards/forwards in the Terminal find window.
Diffstat (limited to 'Userland/Libraries/LibGUI/TextEditor.cpp')
-rw-r--r--Userland/Libraries/LibGUI/TextEditor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp
index aefaa338bd..d6ab1690d2 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();