diff --git a/crates/egui/src/widgets/text_edit/builder.rs b/crates/egui/src/widgets/text_edit/builder.rs index 12e92b90..18c653d0 100644 --- a/crates/egui/src/widgets/text_edit/builder.rs +++ b/crates/egui/src/widgets/text_edit/builder.rs @@ -978,23 +978,7 @@ fn events( break; } } - Event::Key { - key: Key::Z, - pressed: true, - modifiers, - .. - } if modifiers.matches_logically(Modifiers::COMMAND) => { - if let Some((undo_ccursor_range, undo_txt)) = state - .undoer - .lock() - .undo(&(cursor_range.as_ccursor_range(), text.as_str().to_owned())) - { - text.replace_with(undo_txt); - Some(*undo_ccursor_range) - } else { - None - } - } + Event::Key { key, pressed: true, @@ -1016,6 +1000,24 @@ fn events( } } + Event::Key { + key: Key::Z, + pressed: true, + modifiers, + .. + } if modifiers.matches_logically(Modifiers::COMMAND) => { + if let Some((undo_ccursor_range, undo_txt)) = state + .undoer + .lock() + .undo(&(cursor_range.as_ccursor_range(), text.as_str().to_owned())) + { + text.replace_with(undo_txt); + Some(*undo_ccursor_range) + } else { + None + } + } + Event::Key { modifiers, key,