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)
This commit is contained in:
Manik Sharma
2026-02-02 01:14:45 +05:30
committed by Thaddeus Crews
parent fe7a8363df
commit 21e93094c5

View File

@@ -1403,9 +1403,9 @@ void TextEdit::_notification(int p_what) {
// Draw current line highlight.
if (highlight_current_line && highlighted_lines.has(Pair<int, int>(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);
}
}