fix char/byte index mixup in overlay rendering (#10317)
This commit is contained in:
parent
c5e257b81c
commit
f601b7c278
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue