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.

recent projects: fix list flashing/empty (#8376)

Bennet Bo Fenner934af6ad4516
diff --git a/crates/gpui/src/elements/list.rs b/crates/gpui/src/elements/list.rs
index 7961c0df84b..f449862668f 100644
--- a/crates/gpui/src/elements/list.rs
+++ b/crates/gpui/src/elements/list.rs
@@ -548,32 +548,28 @@ impl Element for List {
let summary = state.items.summary();
let total_height = summary.height;
- let all_rendered = summary.unrendered_count == 0;
- if all_rendered {
- cx.request_measured_layout(
- style,
- move |known_dimensions, available_space, _cx| {
- let width = known_dimensions.width.unwrap_or(match available_space
+ cx.request_measured_layout(
+ style,
+ move |known_dimensions, available_space, _cx| {
+ let width =
+ known_dimensions
.width
- {
- AvailableSpace::Definite(x) => x,
- AvailableSpace::MinContent | AvailableSpace::MaxContent => {
- max_element_width
- }
- });
- let height = match available_space.height {
- AvailableSpace::Definite(height) => total_height.min(height),
- AvailableSpace::MinContent | AvailableSpace::MaxContent => {
- total_height
- }
- };
- size(width, height)
- },
- )
- } else {
- cx.request_layout(&style, None)
- }
+ .unwrap_or(match available_space.width {
+ AvailableSpace::Definite(x) => x,
+ AvailableSpace::MinContent | AvailableSpace::MaxContent => {
+ max_element_width
+ }
+ });
+ let height = match available_space.height {
+ AvailableSpace::Definite(height) => total_height.min(height),
+ AvailableSpace::MinContent | AvailableSpace::MaxContent => {
+ total_height
+ }
+ };
+ size(width, height)
+ },
+ )
})
}
ListSizingBehavior::Auto => {