From 86795a9dc7a0f7fdd9a40f5b1e4a12b0c87b8d96 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 22 Jul 2024 16:56:26 -0500 Subject: [PATCH] Return document display name from the '%' special register (#11275) --- helix-view/src/register.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/helix-view/src/register.rs b/helix-view/src/register.rs index 166d2027d..3a2e1b7cc 100644 --- a/helix-view/src/register.rs +++ b/helix-view/src/register.rs @@ -5,7 +5,6 @@ use helix_core::NATIVE_LINE_ENDING; use crate::{ clipboard::{get_clipboard_provider, ClipboardProvider, ClipboardType}, - document::SCRATCH_BUFFER_NAME, Editor, }; @@ -61,14 +60,7 @@ impl Registers { Some(RegisterValues::new(doc.selection(view.id).fragments(text))) } '%' => { - let doc = doc!(editor); - - let path = doc - .path() - .as_ref() - .map(|p| p.to_string_lossy()) - .unwrap_or_else(|| SCRATCH_BUFFER_NAME.into()); - + let path = doc!(editor).display_name(); Some(RegisterValues::new(iter::once(path))) } '*' | '+' => Some(read_from_clipboard(