@@ -1291,6 +1291,7 @@ fn global_search(cx: &mut Context) {
1292 cx.push_layer(Box::new(prompt));
1292 cx.push_layer(Box::new(prompt));
1294+ let root = find_root(None).unwrap_or_else(|| PathBuf::from("./"));
1294 let show_picker = async move {
1295 let show_picker = async move {
1295 let all_matches: Vec<(usize, PathBuf)> =
1296 let all_matches: Vec<(usize, PathBuf)> =
1296 UnboundedReceiverStream::new(all_matches_rx).collect().await;
1297 UnboundedReceiverStream::new(all_matches_rx).collect().await;
@@ -1302,7 +1303,13 @@ fn global_search(cx: &mut Context) {
1303 let picker = FilePicker::new(
1304 let picker = FilePicker::new(
1304 all_matches,
1305 all_matches,
1305− move |(_line_num, path)| path.to_str().unwrap().into(),
1306+ move |(_line_num, path)| {
1307+ path.strip_prefix(&root)
1306 move |editor: &mut Editor, (line_num, path), action| {
1313 move |editor: &mut Editor, (line_num, path), action| {
1307 match editor.open(path.into(), action) {
1314 match editor.open(path.into(), action) {
1308 Ok(_) => {}
1315 Ok(_) => {}