@@ -1017,7 +1017,10 @@ fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Rege
1017 let selection = doc.selection(view.id);
1017 let selection = doc.selection(view.id);
1019 // Get the right side of the primary block cursor.
1019 // Get the right side of the primary block cursor.
1020− let start = graphemes::next_grapheme_boundary(text, selection.primary().cursor(text));
1020+ let start = text.char_to_byte(graphemes::next_grapheme_boundary(
1022+ selection.primary().cursor(text),
1022 // use find_at to find the next match after the cursor, loop around the end
1025 // use find_at to find the next match after the cursor, loop around the end
1023 // Careful, `Regex` uses `bytes` as offsets, not character indices!
1026 // Careful, `Regex` uses `bytes` as offsets, not character indices!