graphemes: fix nth_prev_grapheme_boundary calculation.

This commit is contained in:
Blaž Hrastnik 2021-02-26 15:53:01 +09:00
parent 1ae7c43391
commit ad58286dc7

View file

@ -62,7 +62,7 @@ pub fn nth_prev_grapheme_boundary(slice: RopeSlice, char_idx: usize, n: usize) -
}
}
}
let tmp = byte_to_char_idx(chunk, byte_idx + chunk_byte_idx);
let tmp = byte_to_char_idx(chunk, byte_idx - chunk_byte_idx);
chunk_char_idx + tmp
}