diff options
author | Blaž Hrastnik | 2021-08-20 02:14:57 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-08-20 02:14:57 +0000 |
commit | 07fea61d03bef6004f5d2803e67c1175524fb74f (patch) | |
tree | 9b38620d13a8384bf26339963a7af1e65275d8a5 | |
parent | f60b549fb7c21ff92fe635729198555d704e5f93 (diff) |
Use the correct search register
-rw-r--r-- | helix-term/src/commands.rs | 6 |
1 files 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, ®ex, 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); } |