From 5102c4c002c0f21fc57a61561d0ae7e175fd9b41 Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Tue, 29 Apr 2025 04:48:24 +0530 Subject: [PATCH] gpui: Fix markdown wrapped background not correctly rendering (#29571) Closes #29532 Fixes case where the markdown background was not rendering correctly. This regression was introduced in https://github.com/zed-industries/zed/pull/26454. image Release Notes: - Fixed an issue where markdown code blocks did not wrap correctly. --- crates/gpui/src/text_system/line.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/gpui/src/text_system/line.rs b/crates/gpui/src/text_system/line.rs index ee351c342a00d9873478e04067866dd7f78d9f0b..3813393d81deaff4ed9adb1d96e204b75953233f 100644 --- a/crates/gpui/src/text_system/line.rs +++ b/crates/gpui/src/text_system/line.rs @@ -482,6 +482,16 @@ fn paint_line_background( background_origin.x = origin.x; background_origin.y += line_height; } + + glyph_origin.x = aligned_origin_x( + origin, + align_width.unwrap_or(layout.width), + glyph.position.x, + &align, + layout, + wraps.peek(), + ); + glyph_origin.y += line_height; } prev_glyph_position = glyph.position;