From bc47a2730edc01e4294de8186f3fd95e18a49ff4 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 8 Feb 2025 17:02:17 +0200 Subject: [PATCH] fix search navigation update --- .../window/tab/item/page/search/form.rs | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/app/browser/window/tab/item/page/search/form.rs b/src/app/browser/window/tab/item/page/search/form.rs index 5762ac1d..d8a10715 100644 --- a/src/app/browser/window/tab/item/page/search/form.rs +++ b/src/app/browser/window/tab/item/page/search/form.rs @@ -90,6 +90,7 @@ impl Form { } None => todo!(), // unexpected } + navigation.update() } } None => todo!(), @@ -125,17 +126,19 @@ impl Form { let navigation = navigation.clone(); let result = result.clone(); let subject = subject.clone(); - move |_| match subject.borrow().as_ref() { - Some(subject) => { - match navigation.back(subject) { + move |_| { + match subject.borrow().as_ref() { + Some(subject) => match navigation.back(subject) { Some((mut start, _)) => { result.update(navigation.position(), navigation.total()); scroll_to_iter(&subject.text_view, &mut start) } None => todo!(), // unexpected - } + }, + + None => todo!(), } - None => todo!(), + navigation.update() } }); @@ -143,15 +146,19 @@ impl Form { let navigation = navigation.clone(); let result = result.clone(); let subject = subject.clone(); - move |_| match subject.borrow().as_ref() { - Some(subject) => match navigation.forward(subject) { - Some((mut start, _)) => { - result.update(navigation.position(), navigation.total()); - scroll_to_iter(&subject.text_view, &mut start) - } - None => todo!(), // unexpected - }, - None => todo!(), + move |_| { + match subject.borrow().as_ref() { + Some(subject) => match navigation.forward(subject) { + Some((mut start, _)) => { + result.update(navigation.position(), navigation.total()); + scroll_to_iter(&subject.text_view, &mut start) + } + None => todo!(), // unexpected + }, + + None => todo!(), + } + navigation.update() } });