This commit is contained in:
Antonio Scandurra 2021-05-25 14:16:33 +02:00
parent bafac35d6a
commit 2e7593dd79
2 changed files with 2 additions and 5 deletions

View File

@ -418,11 +418,10 @@ impl FoldMapSnapshot {
transform_cursor.seek(&offset, SeekBias::Right, &());
let overshoot = offset.0 - transform_cursor.start().display.bytes;
let buffer_offset = transform_cursor.start().buffer.bytes + overshoot;
let rope_cursor = self.buffer.text_for_range(buffer_offset..self.buffer.len());
Chunks {
transform_cursor,
buffer_offset,
buffer_chunks: rope_cursor,
buffer_chunks: self.buffer.text_for_range(buffer_offset..self.buffer.len()),
}
}

View File

@ -377,9 +377,7 @@ impl<'a> Iterator for HighlightedChunks<'a> {
}
}
let style_id = self.style_id;
self.style_id = StyleId::default();
Some((mem::take(&mut self.chunk), style_id))
Some((mem::take(&mut self.chunk), mem::take(&mut self.style_id)))
}
}