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
259 dev_server_project.paths.join("")259 dev_server_project.paths.join("")
260 )260 )
261 }261 }
262 SerializedWorkspaceLocation::Ssh(ssh_project) => {262 SerializedWorkspaceLocation::Ssh(ssh_project) => ssh_project
263 format!(263 .ssh_urls()
264 "{}{}{}{}",264 .iter()
265 ssh_project.host,265 .map(|path| path.to_string_lossy().to_string())
266 ssh_project266 .collect::<Vec<_>>()
267 .port267 .join(""),
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 }
279 };268 };
280 269
281 StringMatchCandidate::new(id, combined_string)270 StringMatchCandidate::new(id, combined_string)
@@ -458,6 +447,7 @@ impl PickerDelegate for RecentProjectsDelegate { · 176 unmodified lines
458 .order()447 .order()
459 .iter()448 .iter()
460 .filter_map(|i| paths.paths().get(*i).cloned())449 .filter_map(|i| paths.paths().get(*i).cloned())
450 .map(|path| path.compact())
461 .collect(),451 .collect(),
462 ),452 ),
463 SerializedWorkspaceLocation::Ssh(ssh_project) => Arc::new(ssh_project.ssh_urls()),453 SerializedWorkspaceLocation::Ssh(ssh_project) => Arc::new(ssh_project.ssh_urls()),
@@ -473,7 +463,6 @@ impl PickerDelegate for RecentProjectsDelegate { · 9 unmodified lines
473 let (match_labels, paths): (Vec<_>, Vec<_>) = paths463 let (match_labels, paths): (Vec<_>, Vec<_>) = paths
474 .iter()464 .iter()
475 .map(|path| {465 .map(|path| {
476 let path = path.compact();
477 let highlighted_text =466 let highlighted_text =
478 highlights_for_path(path.as_ref(), &hit.positions, path_start_offset);467 highlights_for_path(path.as_ref(), &hit.positions, path_start_offset);
479 468
@@ -704,7 +693,6 @@ fn highlights_for_path( · 224 unmodified lines
704 },693 },
705 )694 )
706}695}
707
708impl RecentProjectsDelegate {696impl RecentProjectsDelegate {
709 fn delete_recent_project(&self, ix: usize, cx: &mut ViewContext<Picker<Self>>) {697 fn delete_recent_project(&self, ix: usize, cx: &mut ViewContext<Picker<Self>>) {
710 if let Some(selected_match) = self.matches.get(ix) {698 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