Center the selected item when updating outline query
Co-Authored-By: Max Brunsfeld <max@zed.dev> Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
e4c0fc6ad5
commit
ce51196eab
5 changed files with 54 additions and 22 deletions
|
@ -140,7 +140,8 @@ impl ThemeSelector {
|
|||
if self.selected_index > 0 {
|
||||
self.selected_index -= 1;
|
||||
}
|
||||
self.list_state.scroll_to(self.selected_index);
|
||||
self.list_state
|
||||
.scroll_to(ScrollTarget::Show(self.selected_index));
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
|
@ -148,7 +149,8 @@ impl ThemeSelector {
|
|||
if self.selected_index + 1 < self.matches.len() {
|
||||
self.selected_index += 1;
|
||||
}
|
||||
self.list_state.scroll_to(self.selected_index);
|
||||
self.list_state
|
||||
.scroll_to(ScrollTarget::Show(self.selected_index));
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue