Handle erroneously ignored case in RopeGraphemes iterator.
This commit is contained in:
parent
7f6265ecf3
commit
9cbf564d08
1 changed files with 4 additions and 0 deletions
|
@ -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!(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue