aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core/src')
-rw-r--r--helix-core/src/graphemes.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-core/src/graphemes.rs b/helix-core/src/graphemes.rs
index af740f61..2e6a925f 100644
--- a/helix-core/src/graphemes.rs
+++ b/helix-core/src/graphemes.rs
@@ -207,6 +207,10 @@ impl<'a> Iterator for RopeGraphemes<'a> {
self.cur_chunk_start += self.cur_chunk.len();
self.cur_chunk = self.chunks.next().unwrap_or("");
}
+ Err(GraphemeIncomplete::PreContext(idx)) => {
+ let (chunk, byte_idx, _, _) = self.text.chunk_at_byte(idx.saturating_sub(1));
+ self.cursor.provide_context(chunk, byte_idx);
+ }
_ => unreachable!(),
}
}