From bccad5c90d28a01897e7a0d30e15c717c828bbef Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 14:31:50 +0000 Subject: [PATCH] M3: Previous and Next view let go of a find step's match, as other jumps do (#3530) Previous view while a wheel zoom was still easing kept find_hold, so the rest of the zoom anchored on the old match and the history jump waited until zooming stopped (CodeRabbit on #4139). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LymhVaGZCWwB9HNEbLzeMM --- crates/ui-egui/src/canvas.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index ebe5dfc6e7..137b2c49eb 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -1550,6 +1550,8 @@ impl DocView { self.goto = Some((page, 0.0)); self.current = page; self.reset_coarse_state(); + // A find step's match belongs to the place left, as for any other jump. + self.find_hold = None; true } @@ -6209,6 +6211,19 @@ trailer << /Root 1 0 R >> assert_eq!(v.zoom_anchor.map(|a| a.0), Some(0), "anchored on the page under the pointer"); } + #[test] + fn previous_view_after_a_find_step_lets_go_of_the_match() { + let mut v = history_search_view(); + v.screen_rects = vec![(0, Rect::from_min_size(pos2(100.0, 20.0), vec2(300.0, 400.0)))]; + v.find_step(true); + // Previous view while a wheel zoom is still easing: the zoom must not hold the old match + // and put the history jump off until it stops. + assert!(v.view_history(false)); + assert_eq!(v.goto, Some((0, 0.0))); + v.zoom_at(2.0, pos2(150.0, 50.0)); + assert_eq!(v.zoom_anchor.map(|a| a.0), Some(0), "anchored on the page under the pointer"); + } + #[test] fn a_match_with_unbounded_glyphs_falls_back_to_its_page() { let mut v = history_search_view();