diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs index bcbaa3519fc5..f530961f6236 100644 --- a/helix-term/src/ui/document.rs +++ b/helix-term/src/ui/document.rs @@ -300,12 +300,12 @@ pub fn render_text<'t>( } // acquire the correct grapheme style - if char_pos >= syntax_style_span.1 { + while char_pos >= syntax_style_span.1 { syntax_style_span = syntax_styles .next() .unwrap_or((Style::default(), usize::MAX)); } - if char_pos >= overlay_style_span.1 { + while char_pos >= overlay_style_span.1 { overlay_style_span = overlay_styles .next() .unwrap_or((Style::default(), usize::MAX));