Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap system and primary clipboard registers #8703

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions helix-view/src/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ impl Registers {
self.clipboard_provider.as_ref(),
self.inner.get(&name),
match name {
'*' => ClipboardType::Clipboard,
'+' => ClipboardType::Selection,
'+' => ClipboardType::Clipboard,
'*' => ClipboardType::Selection,
_ => unreachable!(),
},
)),
Expand All @@ -95,8 +95,8 @@ impl Registers {
self.clipboard_provider.set_contents(
values.join(NATIVE_LINE_ENDING.as_str()),
match name {
'*' => ClipboardType::Clipboard,
'+' => ClipboardType::Selection,
'+' => ClipboardType::Clipboard,
'*' => ClipboardType::Selection,
_ => unreachable!(),
},
)?;
Expand All @@ -118,8 +118,8 @@ impl Registers {
'#' | '.' | '%' => Err(anyhow::anyhow!("Register {name} does not support pushing")),
'*' | '+' => {
let clipboard_type = match name {
'*' => ClipboardType::Clipboard,
'+' => ClipboardType::Selection,
'+' => ClipboardType::Clipboard,
'*' => ClipboardType::Selection,
_ => unreachable!(),
};
let contents = self.clipboard_provider.get_contents(clipboard_type)?;
Expand Down Expand Up @@ -172,8 +172,8 @@ impl Registers {
('#', "<selection indices>"),
('.', "<selection contents>"),
('%', "<document path>"),
('*', "<system clipboard>"),
('+', "<primary clipboard>"),
('+', "<system clipboard>"),
('*', "<primary clipboard>"),
]
.iter()
.copied(),
Expand All @@ -190,8 +190,8 @@ impl Registers {
match name {
'*' | '+' => {
self.clear_clipboard(match name {
'*' => ClipboardType::Clipboard,
'+' => ClipboardType::Selection,
'+' => ClipboardType::Clipboard,
'*' => ClipboardType::Selection,
_ => unreachable!(),
});
self.inner.remove(&name);
Expand Down
Loading