on master help sign in
Handle erroneously ignored case in RopeGraphemes iterator.
9cbf564Nathan Vegdahl
helix-core/src/graphemes.rs+4
@@ -207,6 +207,10 @@ impl<'a> Iterator for RopeGraphemes<'a> {
207 self.cur_chunk_start += self.cur_chunk.len();
207 self.cur_chunk_start += self.cur_chunk.len();
208 self.cur_chunk = self.chunks.next().unwrap_or("");
208 self.cur_chunk = self.chunks.next().unwrap_or("");
209 }
209 }
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+ }
210 _ => unreachable!(),
214 _ => unreachable!(),
211 }
215 }
212 }
216 }