@@ -654,8 +654,13 @@ where
654654 range.head
655655 };
656656
657− search_fn(text, ch, search_start_pos, count, inclusive)
658− .map_or(range, |pos| range.put_cursor(text, pos, extend))
657+ search_fn(text, ch, search_start_pos, count, inclusive).map_or(range, |pos| {
658+ if extend {
659+ range.put_cursor(text, pos, true)
660+ } else {
661+ Range::point(range.cursor(text)).put_cursor(text, pos, true)
662+ }
663+ })
659664 });
660665 doc.set_selection(view.id, selection);
661666 })