@@ -1017,7 +1017,10 @@ fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Rege
10171017 let selection = doc.selection(view.id);
10181018
10191019 // 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(
1021+ text,
1022+ selection.primary().cursor(text),
1023+ ));
10211024
10221025 // use find_at to find the next match after the cursor, loop around the end
10231026 // Careful, `Regex` uses `bytes` as offsets, not character indices!