graphemes: fix nth_prev_grapheme_boundary calculation.
commitad58286dc7e1f37d0b9edf4a0ee9b5f48ab026a9
authorBlaž Hrastnik <blaz@mxxn.io>
dateFri 26 Feb 2021, 15:53 (6 years ago)
parent1ae7c43
helix-core/src/graphemes.rs+1−1
@@ -62,7 +62,7 @@ pub fn nth_prev_grapheme_boundary(slice: RopeSlice, char_idx: usize, n: usize) -
6262 }
6363 }
6464 }
65− let tmp = byte_to_char_idx(chunk, byte_idx + chunk_byte_idx);
65+ let tmp = byte_to_char_idx(chunk, byte_idx - chunk_byte_idx);
6666 chunk_char_idx + tmp
6767}
6868