summaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorNathaniel Graham2022-10-14 17:51:15 +0000
committerGitHub2022-10-14 17:51:15 +0000
commite80beaa7b09a9852c17563b31fc8b10df2a7742f (patch)
tree3d4c76f2e3ba246dce3f4fc13aa4e347aab359ec /helix-term/src/commands.rs
parent2d958d6c50b10318e29f6dacc291d8fcafd66de9 (diff)
Changed Selection Yank Message (#4275)
Co-authored-by: Nathaniel Graham <ngraham@protonmail.com>
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs15
1 files changed, 13 insertions, 2 deletions
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(())
}