1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:15:08 +00:00

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.
This commit is contained in:
martinfalisse 2022-04-07 18:42:13 +02:00 committed by Ali Mohammad Pur
parent 356eca7e33
commit daaa8a57f0

View file

@ -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) {