on master help sign in
Fix bug with `/` searching after non-ascii characters.

Forgot to convert from char indices to byte indices before passing to the regex engine.

commit285aba2de5af5d7a45b0640e7e09764b611f6a7b authorNathan Vegdahl <cessen@cessen.com> dateWed 28 Jul 2021, 16:03 (5 years ago) parentcd7302f
1 file changed+4−1
helix-term/src/commands.rs+4−1
helix-term/src/commands.rs+4−1
@@ -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!