From daaa8a57f0d7e638c434b08b22a5f2bc107480a6 Mon Sep 17 00:00:00 2001 From: martinfalisse Date: Thu, 7 Apr 2022 18:42:13 +0200 Subject: [PATCH] LibGUI: Disable editing cell when ctrl key is pressed Disable cell editing when the ctrl key is pressed. This fixes a bug where when doing ctrl+z (undo) and there are no more undo actions on the undo_stack, then a "z" is entered into the cell. --- Userland/Libraries/LibGUI/TableView.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/TableView.cpp b/Userland/Libraries/LibGUI/TableView.cpp index 0820bb4172..f1b4481f46 100644 --- a/Userland/Libraries/LibGUI/TableView.cpp +++ b/Userland/Libraries/LibGUI/TableView.cpp @@ -174,7 +174,8 @@ void TableView::keydown_event(KeyEvent& event) auto is_delete = event.key() == Key_Delete; auto is_backspace = event.key() == Key_Backspace; auto is_clear = is_delete || is_backspace; - if (is_editable() && edit_triggers() & EditTrigger::AnyKeyPressed && (event.code_point() != 0 || is_clear)) { + auto has_ctrl = event.modifiers() & KeyModifier::Mod_Ctrl; + if (is_editable() && edit_triggers() & EditTrigger::AnyKeyPressed && (event.code_point() != 0 || is_clear) && !has_ctrl) { begin_editing(cursor_index()); if (m_editing_delegate) { if (is_delete) {