Skip to content

Commit a74e760

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

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
@@ -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

0 commit comments

Comments
 (0)