From 6da8ec4b8693c1e986d6772b74783da714267958 Mon Sep 17 00:00:00 2001 From: Combiler01 Date: Sat, 31 Oct 2026 19:37:22 +0530 Subject: [PATCH] fix(ui): preserve test-verified selection and paste recency semantics --- crates/ui-egui/src/tools/content_ui.rs | 2 +- crates/ui-egui/src/tools/edit_text_ui.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tools/content_ui.rs b/crates/ui-egui/src/tools/content_ui.rs index b005b21262..7e52502530 100644 --- a/crates/ui-egui/src/tools/content_ui.rs +++ b/crates/ui-egui/src/tools/content_ui.rs @@ -1048,7 +1048,7 @@ impl crate::PdfCraftApp { } let command_recent = self .last_command_frame - .is_some_and(|(f, t)| if inp.time > 0.0 { (inp.time - t).abs() < 0.35 } else { self.frame_count.saturating_sub(f) <= 10 }); + .is_some_and(|(f, t)| self.frame_count.saturating_sub(f) <= 10 || (inp.time > 0.0 && (inp.time - t).abs() < 0.35)); let command_active = modifiers.command || command_recent; if !*pressed && !self.v_pressed && command_active { released = true; diff --git a/crates/ui-egui/src/tools/edit_text_ui.rs b/crates/ui-egui/src/tools/edit_text_ui.rs index a2c30e8e03..371140ae68 100644 --- a/crates/ui-egui/src/tools/edit_text_ui.rs +++ b/crates/ui-egui/src/tools/edit_text_ui.rs @@ -703,6 +703,7 @@ impl LineEditor { self.look0 = self.look.clone(); self.extras0 = self.extras; self.original = self.text.clone(); + self.selection = None; // The page now has this text: the box's history restarts, even when the format left the // text as it was, so a Redo from before can't put undone typing back on top of it. self.typing_from = None;