Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion crates/picker/src/highlighted_match_with_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use ui::{HighlightedLabel, prelude::*};

#[derive(Clone)]
pub struct HighlightedMatchWithPaths {
pub prefix: Option<SharedString>,
pub match_label: HighlightedMatch,
pub paths: Vec<HighlightedMatch>,
}
Expand Down Expand Up @@ -67,7 +68,14 @@ impl HighlightedMatchWithPaths {
impl RenderOnce for HighlightedMatchWithPaths {
fn render(mut self, _window: &mut Window, _: &mut App) -> impl IntoElement {
v_flex()
.child(self.match_label.clone())
.child(
h_flex().gap_1().child(self.match_label.clone()).when_some(
self.prefix.as_ref(),
|this, prefix| {
this.child(Label::new(format!("({})", prefix)).color(Color::Muted))
},
),
)
.when(!self.paths.is_empty(), |this| {
self.render_paths_children(this)
})
Expand Down
8 changes: 8 additions & 0 deletions crates/recent_projects/src/recent_projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,15 @@ impl PickerDelegate for RecentProjectsDelegate {
})
.unzip();

let prefix = match &location {
SerializedWorkspaceLocation::Remote(RemoteConnectionOptions::Wsl(wsl)) => {
Some(SharedString::from(&wsl.distro_name))
}
_ => None,
};

let highlighted_match = HighlightedMatchWithPaths {
prefix,
match_label: HighlightedMatch::join(match_labels.into_iter().flatten(), ", "),
paths,
};
Expand Down
Loading