diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 104db459061d..f4844170addc 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1488,11 +1488,11 @@ fn search_impl( // Get the right side of the primary block cursor for forward search, or the // grapheme before the start of the selection for reverse search. let start = match direction { - Direction::Forward => text.char_to_byte(graphemes::next_grapheme_boundary( + Direction::Forward => text.char_to_byte(graphemes::ensure_grapheme_boundary_next( text, selection.primary().to(), )), - Direction::Backward => text.char_to_byte(graphemes::prev_grapheme_boundary( + Direction::Backward => text.char_to_byte(graphemes::ensure_grapheme_boundary_prev( text, selection.primary().from(), )),