Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Reveal item even if project panel was closed while active entry changed

Antonio Scandurra68cf631cfcdb
diff --git a/crates/gpui2/src/elements/uniform_list.rs b/crates/gpui2/src/elements/uniform_list.rs
index c26cfe61214..e38a37f90d2 100644
--- a/crates/gpui2/src/elements/uniform_list.rs
+++ b/crates/gpui2/src/elements/uniform_list.rs
@@ -190,7 +190,15 @@ impl Element for UniformList {
let shared_scroll_offset = element_state
.interactive
.scroll_offset
- .get_or_insert_with(Rc::default)
+ .get_or_insert_with(|| {
+ if let Some(scroll_handle) = self.scroll_handle.as_ref() {
+ if let Some(scroll_handle) = scroll_handle.0.borrow().as_ref() {
+ return scroll_handle.scroll_offset.clone();
+ }
+ }
+
+ Rc::default()
+ })
.clone();
let item_height = self.measure_item(Some(padded_bounds.size.width), cx).height;