Skip to content

Commit

Permalink
fix char/byte index mixup in overlay rendering (helix-editor#10317)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe authored and Vulpesx committed Jun 7, 2024
1 parent 5ad0352 commit f35b79f
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 f35b79f

Please sign in to comment.