on master help sign in
Fix start-position of next search (#1904)
8165febjeepee
helix-term/src/commands.rs+2−2
@@ -1488,11 +1488,11 @@ fn search_impl(
1488 // Get the right side of the primary block cursor for forward search, or the
1488 // Get the right side of the primary block cursor for forward search, or the
1489 // grapheme before the start of the selection for reverse search.
1489 // grapheme before the start of the selection for reverse search.
1490 let start = match direction {
1490 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(
1492 text,
1492 text,
1493 selection.primary().to(),
1493 selection.primary().to(),
1494 )),
1494 )),
1495− Direction::Backward => text.char_to_byte(graphemes::prev_grapheme_boundary(
1495+ Direction::Backward => text.char_to_byte(graphemes::ensure_grapheme_boundary_prev(
1496 text,
1496 text,
1497 selection.primary().from(),
1497 selection.primary().from(),
1498 )),
1498 )),