diff --git a/crates/gpui/src/text_system/line.rs b/crates/gpui/src/text_system/line.rs index 611c979bc29f488fa18386c7b319a7310b6ce1c6..9c6ffdbe3f6fe630ea27651a09006819f0c281ce 100644 --- a/crates/gpui/src/text_system/line.rs +++ b/crates/gpui/src/text_system/line.rs @@ -385,8 +385,12 @@ fn paint_line( glyph_origin.x - underline_origin.x, underline_style, ); - underline_origin.x = origin.x; - underline_origin.y += line_height; + if glyph.index < run_end { + underline_origin.x = origin.x; + underline_origin.y += line_height; + } else { + current_underline = None; + } } if let Some((strikethrough_origin, strikethrough_style)) = current_strikethrough.as_mut() @@ -399,8 +403,12 @@ fn paint_line( glyph_origin.x - strikethrough_origin.x, strikethrough_style, ); - strikethrough_origin.x = origin.x; - strikethrough_origin.y += line_height; + if glyph.index < run_end { + strikethrough_origin.x = origin.x; + strikethrough_origin.y += line_height; + } else { + current_strikethrough = None; + } } glyph_origin.x = aligned_origin_x( @@ -618,8 +626,12 @@ fn paint_line_background( }, *background_color, )); - background_origin.x = origin.x; - background_origin.y += line_height; + if glyph.index < run_end { + background_origin.x = origin.x; + background_origin.y += line_height; + } else { + current_background = None; + } } glyph_origin.x = aligned_origin_x(