From ad58286dc7e1f37d0b9edf4a0ee9b5f48ab026a9 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 26 Feb 2021 15:53:01 +0900 Subject: graphemes: fix nth_prev_grapheme_boundary calculation. --- helix-core/src/graphemes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helix-core/src/graphemes.rs') diff --git a/helix-core/src/graphemes.rs b/helix-core/src/graphemes.rs index 786f6a68..e436062a 100644 --- a/helix-core/src/graphemes.rs +++ b/helix-core/src/graphemes.rs @@ -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 } -- cgit v1.2.3-70-g09d2