Fix bug with /
searching after non-ascii characters.
Forgot to convert from char indices to byte indices before passing to the regex engine.
This commit is contained in:
parent
cd7302ffd3
commit
285aba2de5
1 changed files with 4 additions and 1 deletions
|
@ -1017,7 +1017,10 @@ fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Rege
|
||||||
let selection = doc.selection(view.id);
|
let selection = doc.selection(view.id);
|
||||||
|
|
||||||
// Get the right side of the primary block cursor.
|
// Get the right side of the primary block cursor.
|
||||||
let start = graphemes::next_grapheme_boundary(text, selection.primary().cursor(text));
|
let start = text.char_to_byte(graphemes::next_grapheme_boundary(
|
||||||
|
text,
|
||||||
|
selection.primary().cursor(text),
|
||||||
|
));
|
||||||
|
|
||||||
// use find_at to find the next match after the cursor, loop around the end
|
// use find_at to find the next match after the cursor, loop around the end
|
||||||
// Careful, `Regex` uses `bytes` as offsets, not character indices!
|
// Careful, `Regex` uses `bytes` as offsets, not character indices!
|
||||||
|
|
Loading…
Reference in a new issue