From ad58286dc7e1f37d0b9edf4a0ee9b5f48ab026a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= <blaz@mxxn.io>
Date: Fri, 26 Feb 2021 15:53:01 +0900
Subject: [PATCH] graphemes: fix nth_prev_grapheme_boundary calculation.

---
 helix-core/src/graphemes.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
 }