aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-08-20 02:14:57 +0000
committerBlaž Hrastnik2021-08-20 02:14:57 +0000
commit07fea61d03bef6004f5d2803e67c1175524fb74f (patch)
tree9b38620d13a8384bf26339963a7af1e65275d8a5 /helix-term
parentf60b549fb7c21ff92fe635729198555d704e5f93 (diff)
Use the correct search register
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands.rs6
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, &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);
}