Skip to content

Commit

Permalink
fix char/byte index mixup in overlay rendering (#10317)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe authored Apr 9, 2024
1 parent c5e257b commit f601b7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f601b7c

Please sign in to comment.