on master help sign in
Fix crash if typing | (regex or) into the prompt.
54de768Blaž Hrastnik
helix-term/src/commands.rs+5
@@ -639,6 +639,11 @@ fn _search(doc: &mut Document, view: &mut View, contents: &str, regex: &Regex, e
639 let start = text.byte_to_char(mat.start());
639 let start = text.byte_to_char(mat.start());
640 let end = text.byte_to_char(mat.end());
640 let end = text.byte_to_char(mat.end());
641
641
642+ if end == 0 {
643+ // skip empty matches that don't make sense
644+ return;
645+ }
646+
642 let head = end - 1;
647 let head = end - 1;
643
648
644 let selection = if extend {
649 let selection = if extend {