From 21e93094c535c79ecb3ad485fb61343d5631d0d0 Mon Sep 17 00:00:00 2001 From: Manik Sharma Date: Mon, 2 Feb 2026 01:14:45 +0530 Subject: [PATCH] Fix current line highlight not extending into gutter Fixes regression where current line highlight no longer extends into the gutter area. The highlight now starts from 0 instead of xmargin_beg, making it extend all the way to the left edge. This restores the 4.5.1 behavior where the current line highlight spans the entire line including the gutter area and left margin. (cherry picked from commit 4dfbd909acc7e20d5b58bc5a135509ad97499956) --- scene/gui/text_edit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f00e67fa24..618e62c9d0 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1403,9 +1403,9 @@ void TextEdit::_notification(int p_what) { // Draw current line highlight. if (highlight_current_line && highlighted_lines.has(Pair(line, line_wrap_index))) { if (rtl) { - RS::get_singleton()->canvas_item_add_rect(text_ci, Rect2(size.width - xmargin_end, ofs_y, xmargin_end - xmargin_beg, row_height), theme_cache.current_line_color); + RS::get_singleton()->canvas_item_add_rect(text_ci, Rect2(size.width - xmargin_end, ofs_y, xmargin_end, row_height), theme_cache.current_line_color); } else { - RS::get_singleton()->canvas_item_add_rect(text_ci, Rect2(xmargin_beg, ofs_y, xmargin_end - xmargin_beg, row_height), theme_cache.current_line_color); + RS::get_singleton()->canvas_item_add_rect(text_ci, Rect2(0, ofs_y, xmargin_end, row_height), theme_cache.current_line_color); } }