Skip to content

Commit

Permalink
Return document display name from the '%' special register (#11275)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis authored Jul 22, 2024
1 parent d47e085 commit 86795a9
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions helix-view/src/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use helix_core::NATIVE_LINE_ENDING;

use crate::{
clipboard::{get_clipboard_provider, ClipboardProvider, ClipboardType},
document::SCRATCH_BUFFER_NAME,
Editor,
};

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 86795a9

Please sign in to comment.