on master help sign in
Use the correct search register
commit07fea61d03bef6004f5d2803e67c1175524fb74f authorBlaž Hrastnik <blaz@mxxn.io> dateFri 20 Aug 2021, 11:14 (5 years ago) parentf60b549
1 file changed+3−3
helix-term/src/commands.rs+3−3
helix-term/src/commands.rs+3−3
@@ -1154,7 +1154,7 @@ fn search(cx: &mut Context) {
11541154 move |view, doc, registers, regex| {
11551155 search_impl(doc, view, &contents, &regex, false);
11561156 // TODO: only store on enter (accept), not update
1157− registers.write('\\', vec![regex.as_str().to_string()]);
1157+ registers.write('/', vec![regex.as_str().to_string()]);
11581158 },
11591159 );
11601160
@@ -1164,7 +1164,7 @@ fn search(cx: &mut Context) {
11641164fn search_next_impl(cx: &mut Context, extend: bool) {
11651165 let (view, doc) = current!(cx.editor);
11661166 let registers = &mut cx.editor.registers;
1167− if let Some(query) = registers.read('\\') {
1167+ if let Some(query) = registers.read('/') {
11681168 let query = query.first().unwrap();
11691169 let contents = doc.text().slice(..).to_string();
11701170 let regex = Regex::new(query).unwrap();
@@ -1185,7 +1185,7 @@ fn search_selection(cx: &mut Context) {
11851185 let contents = doc.text().slice(..);
11861186 let query = doc.selection(view.id).primary().fragment(contents);
11871187 let regex = regex::escape(&query);
1188− cx.editor.registers.write('\\', vec![regex]);
1188+ cx.editor.registers.write('/', vec![regex]);
11891189 search_next(cx);
11901190}
11911191