diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index bca27f5f85ae9..02c83ad2808b3 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -1467,7 +1467,9 @@ impl ProjectPanel { } let first = first_iter - .take_until(|ele| *ele == root_entry) + .enumerate() + .take_until(|(count, ele)| *ele == root_entry && *count != 0usize) + .map(|(_, ele)| ele) .find(|ele| predicate(ele, tree_id)) .cloned();