From 4dfbd909acc7e20d5b58bc5a135509ad97499956 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. --- 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 b2a9c606b67..962da7e8876 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); } }