From 07fea61d03bef6004f5d2803e67c1175524fb74f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= <blaz@mxxn.io>
Date: Fri, 20 Aug 2021 11:14:57 +0900
Subject: [PATCH] Use the correct search register

---
 helix-term/src/commands.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 58a0e55f..7c3eeb4c 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1154,7 +1154,7 @@ fn search(cx: &mut Context) {
         move |view, doc, registers, regex| {
             search_impl(doc, view, &contents, &regex, false);
             // TODO: only store on enter (accept), not update
-            registers.write('\\', vec![regex.as_str().to_string()]);
+            registers.write('/', vec![regex.as_str().to_string()]);
         },
     );
 
@@ -1164,7 +1164,7 @@ fn search(cx: &mut Context) {
 fn search_next_impl(cx: &mut Context, extend: bool) {
     let (view, doc) = current!(cx.editor);
     let registers = &mut cx.editor.registers;
-    if let Some(query) = registers.read('\\') {
+    if let Some(query) = registers.read('/') {
         let query = query.first().unwrap();
         let contents = doc.text().slice(..).to_string();
         let regex = Regex::new(query).unwrap();
@@ -1185,7 +1185,7 @@ fn search_selection(cx: &mut Context) {
     let contents = doc.text().slice(..);
     let query = doc.selection(view.id).primary().fragment(contents);
     let regex = regex::escape(&query);
-    cx.editor.registers.write('\\', vec![regex]);
+    cx.editor.registers.write('/', vec![regex]);
     search_next(cx);
 }