fix char/byte index mixup in overlay rendering (#10317)
This commit is contained in:
parent
c5e257b81c
commit
f601b7c278
|
@ -350,7 +350,8 @@ pub fn overlay_syntax_highlights(
|
|||
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…
Reference in a new issue