diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index a64ef6a8..e32e8e6e 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -502,7 +502,8 @@ pub struct UiState { pub paste_event: bool, /// The window got the focus back since the last V release. pub refocused: bool, - /// The modifiers held, as of the last raw event that told: a paste event doesn't carry them. + /// The modifiers held, as of the last modifier change in the raw events: a paste event doesn't + /// carry them. pub held: egui::Modifiers, /// When (UI clock, seconds) open documents next get an autosave checkpoint. pub next_autosave: f64, diff --git a/crates/ui-egui/src/paste_image_tests.rs b/crates/ui-egui/src/paste_image_tests.rs index 23cec8ea..48bd142e 100644 --- a/crates/ui-egui/src/paste_image_tests.rs +++ b/crates/ui-egui/src/paste_image_tests.rs @@ -231,13 +231,11 @@ fn the_browser_sequence_pastes_once() { } #[test] -fn v_alone_and_other_paste_commands_paste_nothing() { +fn v_alone_pastes_nothing() { let mut w = Win::new(); w.copy_image_elsewhere(); w.frame(vec![key(Key::V, true, Modifiers::NONE)]); w.frame(vec![key(Key::V, false, Modifiers::NONE)]); - w.cmd_v(CMD.plus(Modifiers::SHIFT)); - w.cmd_v(CMD.plus(Modifiers::ALT)); assert_eq!(w.named("Pasted image"), 0); } diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 57295c22..0a291a7c 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -163,9 +163,6 @@ pub fn swallowed_paste(app: &mut FigApp, ctx: &Context) -> Swallowed { let mut out = Swallowed::default(); ctx.input(|i| { for ev in &i.raw.events { - if let Event::Key { modifiers, .. } = ev { - ui.held = *modifiers; - } match ev { Event::ModifiersChanged(m) => ui.held = *m, // Without Cmd/Ctrl held it's another paste key (Shift+Insert, a Paste key).