@@ -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());
643+ // skip empty matches that don't make sense
642 let head = end - 1;
647 let head = end - 1;
644 let selection = if extend {
649 let selection = if extend {