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
|
@ -1,8 +1,8 @@
|
|||
use gpui::{
|
||||
action,
|
||||
elements::{
|
||||
Align, ConstrainedBox, Empty, Flex, Label, MouseEventHandler, ParentElement, Svg,
|
||||
UniformList, UniformListState,
|
||||
Align, ConstrainedBox, Empty, Flex, Label, MouseEventHandler, ParentElement, ScrollTarget,
|
||||
Svg, UniformList, UniformListState,
|
||||
},
|
||||
keymap::{
|
||||
self,
|
||||
|
@ -278,7 +278,7 @@ impl ProjectPanel {
|
|||
|
||||
fn autoscroll(&mut self) {
|
||||
if let Some(selection) = self.selection {
|
||||
self.list.scroll_to(selection.index);
|
||||
self.list.scroll_to(ScrollTarget::Show(selection.index));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue