Scroll to focused item on tab rescan, fixes #1281

This commit is contained in:
Jeremy Soller 2025-12-29 15:57:51 -07:00
parent eaa756182a
commit 5edeea69f9
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA
2 changed files with 21 additions and 2 deletions

View file

@ -1664,6 +1664,7 @@ pub enum Message {
Resize(Rectangle),
Scroll(Viewport),
ScrollTab(f32),
ScrollToFocused,
SearchContext(Location, SearchContextWrapper),
SearchReady(bool),
SelectAll,
@ -3880,6 +3881,13 @@ impl Tab {
.into(),
));
}
Message::ScrollToFocused => {
if let Some(offset) = self.select_focus_scroll() {
commands.push(Command::Iced(
scrollable::scroll_to(self.scrollable_id.clone(), offset).into(),
));
}
}
Message::SearchContext(location, context) => {
if location == self.location {
self.search_context = context.0;