mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-21 17:06:18 +04:00
Return document display name from the '%' special register (#11275)
This commit is contained in:
parent
d47e085fe0
commit
86795a9dc7
@ -5,7 +5,6 @@
|
||||
|
||||
use crate::{
|
||||
clipboard::{get_clipboard_provider, ClipboardProvider, ClipboardType},
|
||||
document::SCRATCH_BUFFER_NAME,
|
||||
Editor,
|
||||
};
|
||||
|
||||
@ -61,14 +60,7 @@ pub fn read<'a>(&'a self, name: char, editor: &'a Editor) -> Option<RegisterValu
|
||||
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(
|
||||
|
Loading…
Reference in New Issue
Block a user