mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-31 01:24:31 +03:00
Use util::paths::compact
This commit is contained in:
parent
69989d0463
commit
b4593cd90b
@ -55,17 +55,13 @@ pub struct HighlightedWorkspaceLocation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl HighlightedWorkspaceLocation {
|
impl HighlightedWorkspaceLocation {
|
||||||
pub fn new(
|
pub fn new(string_match: &StringMatch, location: &WorkspaceLocation) -> Self {
|
||||||
string_match: &StringMatch,
|
|
||||||
location: &WorkspaceLocation,
|
|
||||||
cx: &gpui::AppContext,
|
|
||||||
) -> Self {
|
|
||||||
let mut path_start_offset = 0;
|
let mut path_start_offset = 0;
|
||||||
let (names, paths): (Vec<_>, Vec<_>) = location
|
let (names, paths): (Vec<_>, Vec<_>) = location
|
||||||
.paths()
|
.paths()
|
||||||
.iter()
|
.iter()
|
||||||
.map(|path| {
|
.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(
|
let highlighted_text = Self::highlights_for_path(
|
||||||
full_path.as_ref(),
|
full_path.as_ref(),
|
||||||
&string_match.positions,
|
&string_match.positions,
|
||||||
|
@ -192,7 +192,6 @@ impl PickerDelegate for RecentProjectsView {
|
|||||||
let highlighted_location = HighlightedWorkspaceLocation::new(
|
let highlighted_location = HighlightedWorkspaceLocation::new(
|
||||||
&string_match,
|
&string_match,
|
||||||
&self.workspace_locations[string_match.candidate_id],
|
&self.workspace_locations[string_match.candidate_id],
|
||||||
&cx,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Flex::column()
|
Flex::column()
|
||||||
|
Loading…
Reference in New Issue
Block a user