on master help sign in
Changed Selection Yank Message (#4275)

Co-authored-by: Nathaniel Graham <ngraham@protonmail.com>

commite80beaa7b09a9852c17563b31fc8b10df2a7742f authorNathaniel Graham <nathaniel.graham@protonmail.com> dateFri 14 Oct 2022, 11:51 (4 years ago) parent2d958d6
1 file changed+13−2
helix-term/src/commands.rs+13−2
helix-term/src/commands.rs+13−2
@@ -3345,9 +3345,15 @@ fn yank_joined_to_clipboard_impl(
33453345 .map(Cow::into_owned)
33463346 .collect();
33473347
3348+ let clipboard_text = match clipboard_type {
3349+ ClipboardType::Clipboard => "system clipboard",
3350+ ClipboardType::Selection => "primary clipboard",
3351+ };
3352+
33483353 let msg = format!(
3349− "joined and yanked {} selection(s) to system clipboard",
3354+ "joined and yanked {} selection(s) to {}",
33503355 values.len(),
3356+ clipboard_text,
33513357 );
33523358
33533359 let joined = values.join(separator);
@@ -3376,6 +3382,11 @@ fn yank_main_selection_to_clipboard_impl(
33763382 let (view, doc) = current!(editor);
33773383 let text = doc.text().slice(..);
33783384
3385+ let message_text = match clipboard_type {
3386+ ClipboardType::Clipboard => "yanked main selection to system clipboard",
3387+ ClipboardType::Selection => "yanked main selection to primary clipboard",
3388+ };
3389+
33793390 let value = doc.selection(view.id).primary().fragment(text);
33803391
33813392 if let Err(e) = editor
@@ -3385,7 +3396,7 @@ fn yank_main_selection_to_clipboard_impl(
33853396 bail!("Couldn't set system clipboard content: {}", e);
33863397 }
33873398
3388− editor.set_status("yanked main selection to system clipboard");
3399+ editor.set_status(message_text);
33893400 Ok(())
33903401}
33913402