@@ -1488,11 +1488,11 @@ fn search_impl(
14881488 // Get the right side of the primary block cursor for forward search, or the
14891489 // grapheme before the start of the selection for reverse search.
14901490 let start = match direction {
1491− Direction::Forward => text.char_to_byte(graphemes::next_grapheme_boundary(
1491+ Direction::Forward => text.char_to_byte(graphemes::ensure_grapheme_boundary_next(
14921492 text,
14931493 selection.primary().to(),
14941494 )),
1495− Direction::Backward => text.char_to_byte(graphemes::prev_grapheme_boundary(
1495+ Direction::Backward => text.char_to_byte(graphemes::ensure_grapheme_boundary_prev(
14961496 text,
14971497 selection.primary().from(),
14981498 )),