aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/graphemes.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-02-26 06:53:01 +0000
committerBlaž Hrastnik2021-02-26 06:53:01 +0000
commitad58286dc7e1f37d0b9edf4a0ee9b5f48ab026a9 (patch)
tree6c447e51c775c570f8e1808382f3051148a68652 /helix-core/src/graphemes.rs
parent1ae7c4339194c6f988202b24cd910d8c2edea737 (diff)
graphemes: fix nth_prev_grapheme_boundary calculation.
Diffstat (limited to 'helix-core/src/graphemes.rs')
-rw-r--r--helix-core/src/graphemes.rs2
1 files changed, 1 insertions, 1 deletions
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
}