From b4593cd90b5584517a3102bfdd2336a4a5c4b3eb Mon Sep 17 00:00:00 2001 From: Petros Amoiridis Date: Wed, 29 Mar 2023 17:40:39 +0300 Subject: [PATCH] Use util::paths::compact --- .../recent_projects/src/highlighted_workspace_location.rs | 8 ++------ crates/recent_projects/src/recent_projects.rs | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/recent_projects/src/highlighted_workspace_location.rs b/crates/recent_projects/src/highlighted_workspace_location.rs index bee7594d33..ca8b8b2828 100644 --- a/crates/recent_projects/src/highlighted_workspace_location.rs +++ b/crates/recent_projects/src/highlighted_workspace_location.rs @@ -55,17 +55,13 @@ pub struct HighlightedWorkspaceLocation { } impl HighlightedWorkspaceLocation { - pub fn new( - string_match: &StringMatch, - location: &WorkspaceLocation, - cx: &gpui::AppContext, - ) -> Self { + pub fn new(string_match: &StringMatch, location: &WorkspaceLocation) -> Self { let mut path_start_offset = 0; let (names, paths): (Vec<_>, Vec<_>) = location .paths() .iter() .map(|path| { - let full_path = cx.platform().convert_to_shortened_path(&path); + let full_path = util::paths::compact(&path); let highlighted_text = Self::highlights_for_path( full_path.as_ref(), &string_match.positions, diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs index 81afd694d0..e73d0b4fb5 100644 --- a/crates/recent_projects/src/recent_projects.rs +++ b/crates/recent_projects/src/recent_projects.rs @@ -192,7 +192,6 @@ impl PickerDelegate for RecentProjectsView { let highlighted_location = HighlightedWorkspaceLocation::new( &string_match, &self.workspace_locations[string_match.candidate_id], - &cx, ); Flex::column()