From 9a4c1c019abbc876011e606fa680fe729036e2db Mon Sep 17 00:00:00 2001 From: Andrew January Date: Sun, 22 Aug 2021 11:09:45 +0100 Subject: [PATCH] LibGUI: Make Ctrl+Shift+Right select text Ctrl+Shift+Left would add the word before the cursor to the selection, but for some reason Ctrl+Shift+Right didn't add the word after the cursor to the selection. --- Userland/Libraries/LibGUI/EditingEngine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibGUI/EditingEngine.cpp b/Userland/Libraries/LibGUI/EditingEngine.cpp index 8f49701fb4..c503514fa0 100644 --- a/Userland/Libraries/LibGUI/EditingEngine.cpp +++ b/Userland/Libraries/LibGUI/EditingEngine.cpp @@ -78,7 +78,12 @@ bool EditingEngine::on_key(const KeyEvent& event) } } if (event.ctrl()) { + m_editor->update_selection(event.shift()); move_to_next_span(event); + if (event.shift() && m_editor->selection()->start().is_valid()) { + m_editor->selection()->set_end(m_editor->cursor()); + m_editor->did_update_selection(); + } return true; } m_editor->update_selection(event.shift());