Skip to content

Commit daaa8a5

Browse files
martinfalissealimpfard
authored andcommitted
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.
1 parent 356eca7 commit daaa8a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Userland/Libraries/LibGUI/TableView.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ void TableView::keydown_event(KeyEvent& event)
174174
auto is_delete = event.key() == Key_Delete;
175175
auto is_backspace = event.key() == Key_Backspace;
176176
auto is_clear = is_delete || is_backspace;
177-
if (is_editable() && edit_triggers() & EditTrigger::AnyKeyPressed && (event.code_point() != 0 || is_clear)) {
177+
auto has_ctrl = event.modifiers() & KeyModifier::Mod_Ctrl;
178+
if (is_editable() && edit_triggers() & EditTrigger::AnyKeyPressed && (event.code_point() != 0 || is_clear) && !has_ctrl) {
178179
begin_editing(cursor_index());
179180
if (m_editing_delegate) {
180181
if (is_delete) {

0 commit comments

Comments
 (0)