fix char/byte index mixup in overlay rendering (#10317)

pull/10178/head
Pascal Kuthe 8 months ago committed by GitHub
parent c5e257b81c
commit f601b7c278
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -350,7 +350,8 @@ impl EditorView {
let text = doc.text().slice(..);
let row = text.char_to_line(anchor.min(text.len_chars()));
let range = Self::viewport_byte_range(text, row, height);
let mut range = Self::viewport_byte_range(text, row, height);
range = text.byte_to_char(range.start)..text.byte_to_char(range.end);
text_annotations.collect_overlay_highlights(range)
}

Loading…
Cancel
Save