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.

Show tooltip with item paths for recent project picker items (#8987)

Jason Leebc7fb9f253d0
diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs
index a9ceefee6d8..3655fbb6e6a 100644
--- a/crates/recent_projects/src/recent_projects.rs
+++ b/crates/recent_projects/src/recent_projects.rs
@@ -325,14 +325,21 @@ impl PickerDelegate for RecentProjectsDelegate {
let highlighted_match = HighlightedMatchWithPaths {
match_label: HighlightedText::join(match_labels.into_iter().flatten(), ", "),
- paths: if self.render_paths { paths } else { Vec::new() },
+ paths,
};
+
Some(
ListItem::new(ix)
.inset(true)
.spacing(ListItemSpacing::Sparse)
.selected(selected)
- .child(highlighted_match.clone().render(cx))
+ .child({
+ let mut highlighted = highlighted_match.clone();
+ if !self.render_paths {
+ highlighted.paths.clear();
+ }
+ highlighted.render(cx)
+ })
.when(!is_current_workspace, |el| {
let delete_button = div()
.child(
@@ -344,7 +351,7 @@ impl PickerDelegate for RecentProjectsDelegate {
this.delegate.delete_recent_project(ix, cx)
}))
- .tooltip(|cx| Tooltip::text("Delete From Recent Projects...", cx)),
+ .tooltip(|cx| Tooltip::text("Delete from Recent Projects...", cx)),
)
.into_any_element();