From 1d45f50781f34bccf29a3e4f576cc48651038b09 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Tue, 24 Aug 2021 09:56:09 +0900 Subject: fix: Don't internally use relative paths in the buffer picker Fixes #619 --- helix-term/src/commands.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'helix-term/src') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 56e4f1b6..7434d4cd 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2288,16 +2288,17 @@ fn buffer_picker(cx: &mut Context) { cx.editor .documents .iter() - .map(|(id, doc)| (id, doc.relative_path())) + .map(|(id, doc)| (id, doc.path().cloned())) .collect(), move |(id, path): &(DocumentId, Option)| { - // format_fn + use helix_view::document::relative_path; + let path = path.as_deref().map(relative_path); match path.as_ref().and_then(|path| path.to_str()) { Some(path) => { if *id == current { - format!("{} (*)", path).into() + format!("{} (*)", &path).into() } else { - path.into() + path.to_owned().into() } } None => "[scratch buffer]".into(), -- cgit v1.2.3-70-g09d2