diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index dc767e22..2aac3d33 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -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) }