on master help sign in
Swap system and primary clipboard registers (#8703)
1755c61Omnikar
helix-view/src/register.rs+10−10
@@ -75,8 +75,8 @@ impl Registers {
75 self.clipboard_provider.as_ref(),
75 self.clipboard_provider.as_ref(),
76 self.inner.get(&name),
76 self.inner.get(&name),
77 match name {
77 match name {
78− '*' => ClipboardType::Clipboard,
78+ '+' => ClipboardType::Clipboard,
79− '+' => ClipboardType::Selection,
79+ '*' => ClipboardType::Selection,
80 _ => unreachable!(),
80 _ => unreachable!(),
81 },
81 },
82 )),
82 )),
@@ -95,8 +95,8 @@ impl Registers {
95 self.clipboard_provider.set_contents(
95 self.clipboard_provider.set_contents(
96 values.join(NATIVE_LINE_ENDING.as_str()),
96 values.join(NATIVE_LINE_ENDING.as_str()),
97 match name {
97 match name {
98− '*' => ClipboardType::Clipboard,
98+ '+' => ClipboardType::Clipboard,
99− '+' => ClipboardType::Selection,
99+ '*' => ClipboardType::Selection,
100 _ => unreachable!(),
100 _ => unreachable!(),
101 },
101 },
102 )?;
102 )?;
@@ -118,8 +118,8 @@ impl Registers {
118 '#' | '.' | '%' => Err(anyhow::anyhow!("Register {name} does not support pushing")),
118 '#' | '.' | '%' => Err(anyhow::anyhow!("Register {name} does not support pushing")),
119 '*' | '+' => {
119 '*' | '+' => {
120 let clipboard_type = match name {
120 let clipboard_type = match name {
121− '*' => ClipboardType::Clipboard,
121+ '+' => ClipboardType::Clipboard,
122− '+' => ClipboardType::Selection,
122+ '*' => ClipboardType::Selection,
123 _ => unreachable!(),
123 _ => unreachable!(),
124 };
124 };
125 let contents = self.clipboard_provider.get_contents(clipboard_type)?;
125 let contents = self.clipboard_provider.get_contents(clipboard_type)?;
@@ -172,8 +172,8 @@ impl Registers {
172 ('#', "<selection indices>"),
172 ('#', "<selection indices>"),
173 ('.', "<selection contents>"),
173 ('.', "<selection contents>"),
174 ('%', "<document path>"),
174 ('%', "<document path>"),
175− ('*', "<system clipboard>"),
175+ ('+', "<system clipboard>"),
176− ('+', "<primary clipboard>"),
176+ ('*', "<primary clipboard>"),
177 ]
177 ]
178 .iter()
178 .iter()
179 .copied(),
179 .copied(),
@@ -190,8 +190,8 @@ impl Registers {
190 match name {
190 match name {
191 '*' | '+' => {
191 '*' | '+' => {
192 self.clear_clipboard(match name {
192 self.clear_clipboard(match name {
193− '*' => ClipboardType::Clipboard,
193+ '+' => ClipboardType::Clipboard,
194− '+' => ClipboardType::Selection,
194+ '*' => ClipboardType::Selection,
195 _ => unreachable!(),
195 _ => unreachable!(),
196 });
196 });
197 self.inner.remove(&name);
197 self.inner.remove(&name);