on master help sign in
graphemes: fix nth_prev_grapheme_boundary calculation.
ad58286Blaž Hrastnik
helix-core/src/graphemes.rs+1−1
@@ -62,7 +62,7 @@ pub fn nth_prev_grapheme_boundary(slice: RopeSlice, char_idx: usize, n: usize) -
62 }
62 }
63 }
63 }
64 }
64 }
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);
66 chunk_char_idx + tmp
66 chunk_char_idx + tmp
67}
67}
68
68