History

recent project: Fix highlighting for matches in SSH projs (#18332)

Release Notes: - N/A

Thorsten Ball committed 2 years ago

Commit 4e2ae061 parent 300bf871 file · +7 −19Browse files

Unified · Split

crates/recent_projects/src/recent_projects.rs+7−19
@@ -259,23 +259,12 @@ impl PickerDelegate for RecentProjectsDelegate { · 258 unmodified lines
259259 dev_server_project.paths.join("")
260260 )
261261 }
262− SerializedWorkspaceLocation::Ssh(ssh_project) => {
263− format!(
264− "{}{}{}{}",
265− ssh_project.host,
266− ssh_project
267− .port
268− .as_ref()
269− .map(|port| port.to_string())
270− .unwrap_or_default(),
271− ssh_project.paths.join(","),
272− ssh_project
273− .user
274− .as_ref()
275− .map(|user| user.to_string())
276− .unwrap_or_default()
277− )
278− }
262+ SerializedWorkspaceLocation::Ssh(ssh_project) => ssh_project
263+ .ssh_urls()
264+ .iter()
265+ .map(|path| path.to_string_lossy().to_string())
266+ .collect::<Vec<_>>()
267+ .join(""),
279268 };
280269
281270 StringMatchCandidate::new(id, combined_string)
@@ -458,6 +447,7 @@ impl PickerDelegate for RecentProjectsDelegate { · 176 unmodified lines
458447 .order()
459448 .iter()
460449 .filter_map(|i| paths.paths().get(*i).cloned())
450+ .map(|path| path.compact())
461451 .collect(),
462452 ),
463453 SerializedWorkspaceLocation::Ssh(ssh_project) => Arc::new(ssh_project.ssh_urls()),
@@ -473,7 +463,6 @@ impl PickerDelegate for RecentProjectsDelegate { · 9 unmodified lines
473463 let (match_labels, paths): (Vec<_>, Vec<_>) = paths
474464 .iter()
475465 .map(|path| {
476− let path = path.compact();
477466 let highlighted_text =
478467 highlights_for_path(path.as_ref(), &hit.positions, path_start_offset);
479468
@@ -704,7 +693,6 @@ fn highlights_for_path( · 224 unmodified lines
704693 },
705694 )
706695 }
707−
708696 impl RecentProjectsDelegate {
709697 fn delete_recent_project(&self, ix: usize, cx: &mut ViewContext<Picker<Self>>) {
710698 if let Some(selected_match) = self.matches.get(ix) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t