Skip to content

Commit bac8b89

Browse files
ngraham20Nathaniel Graham
authored andcommitted
Changed Selection Yank Message (helix-editor#4275)
Co-authored-by: Nathaniel Graham <[email protected]>
1 parent ab7735c commit bac8b89

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

helix-term/src/commands.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3508,9 +3508,15 @@ fn yank_joined_to_clipboard_impl(
35083508
.map(Cow::into_owned)
35093509
.collect();
35103510

3511+
let clipboard_text = match clipboard_type {
3512+
ClipboardType::Clipboard => "system clipboard",
3513+
ClipboardType::Selection => "primary clipboard",
3514+
};
3515+
35113516
let msg = format!(
3512-
"joined and yanked {} selection(s) to system clipboard",
3517+
"joined and yanked {} selection(s) to {}",
35133518
values.len(),
3519+
clipboard_text,
35143520
);
35153521

35163522
let joined = values.join(separator);
@@ -3539,6 +3545,11 @@ fn yank_main_selection_to_clipboard_impl(
35393545
let (view, doc) = current!(editor);
35403546
let text = doc.text().slice(..);
35413547

3548+
let message_text = match clipboard_type {
3549+
ClipboardType::Clipboard => "yanked main selection to system clipboard",
3550+
ClipboardType::Selection => "yanked main selection to primary clipboard",
3551+
};
3552+
35423553
let value = doc.selection(view.id).primary().fragment(text);
35433554

35443555
if let Err(e) = editor
@@ -3548,7 +3559,7 @@ fn yank_main_selection_to_clipboard_impl(
35483559
bail!("Couldn't set system clipboard content: {}", e);
35493560
}
35503561

3551-
editor.set_status("yanked main selection to system clipboard");
3562+
editor.set_status(message_text);
35523563
Ok(())
35533564
}
35543565

0 commit comments

Comments
 (0)