From e80beaa7b09a9852c17563b31fc8b10df2a7742f Mon Sep 17 00:00:00 2001 From: Nathaniel Graham Date: Fri, 14 Oct 2022 11:51:15 -0600 Subject: Changed Selection Yank Message (#4275) Co-authored-by: Nathaniel Graham --- helix-term/src/commands.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'helix-term/src') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 93e82b84..d5fc1ad9 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3345,9 +3345,15 @@ fn yank_joined_to_clipboard_impl( .map(Cow::into_owned) .collect(); + let clipboard_text = match clipboard_type { + ClipboardType::Clipboard => "system clipboard", + ClipboardType::Selection => "primary clipboard", + }; + let msg = format!( - "joined and yanked {} selection(s) to system clipboard", + "joined and yanked {} selection(s) to {}", values.len(), + clipboard_text, ); let joined = values.join(separator); @@ -3376,6 +3382,11 @@ fn yank_main_selection_to_clipboard_impl( let (view, doc) = current!(editor); let text = doc.text().slice(..); + let message_text = match clipboard_type { + ClipboardType::Clipboard => "yanked main selection to system clipboard", + ClipboardType::Selection => "yanked main selection to primary clipboard", + }; + let value = doc.selection(view.id).primary().fragment(text); if let Err(e) = editor @@ -3385,7 +3396,7 @@ fn yank_main_selection_to_clipboard_impl( bail!("Couldn't set system clipboard content: {}", e); } - editor.set_status("yanked main selection to system clipboard"); + editor.set_status(message_text); Ok(()) } -- cgit v1.2.3-70-g09d2