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,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()
}
});