fix search navigation update

This commit is contained in:
yggverse 2025-02-08 17:02:17 +02:00
parent 8004f51c70
commit bc47a2730e

View File

@ -90,6 +90,7 @@ impl Form {
}
None => todo!(), // unexpected
}
navigation.update()
}
}
None => todo!(),
@ -125,25 +126,28 @@ 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!(),
}
navigation.update()
}
});
navigation.forward.button.connect_clicked({
let navigation = navigation.clone();
let result = result.clone();
let subject = subject.clone();
move |_| match subject.borrow().as_ref() {
move |_| {
match subject.borrow().as_ref() {
Some(subject) => match navigation.forward(subject) {
Some((mut start, _)) => {
result.update(navigation.position(), navigation.total());
@ -151,8 +155,11 @@ impl Form {
}
None => todo!(), // unexpected
},
None => todo!(),
}
navigation.update()
}
});
// Done