on master help sign in
Handle erroneously ignored case in RopeGraphemes iterator.
commit9cbf564d086a14b413d27f0514aa8f11b92ec880 authorNathan Vegdahl <cessen@cessen.com> dateWed 23 Jun 2021, 16:54 (5 years ago) parent7f6265e
1 file changed+4
helix-core/src/graphemes.rs+4
helix-core/src/graphemes.rs+4
@@ -207,6 +207,10 @@ impl<'a> Iterator for RopeGraphemes<'a> {
207207 self.cur_chunk_start += self.cur_chunk.len();
208208 self.cur_chunk = self.chunks.next().unwrap_or("");
209209 }
210+ Err(GraphemeIncomplete::PreContext(idx)) => {
211+ let (chunk, byte_idx, _, _) = self.text.chunk_at_byte(idx.saturating_sub(1));
212+ self.cursor.provide_context(chunk, byte_idx);
213+ }
210214 _ => unreachable!(),
211215 }
212216 }