From 98438b57b3128e683953f3f2b4ca3cc02424dff5 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Thu, 25 Sep 2025 18:23:46 +0200 Subject: [PATCH] fix for line rendering issue due to horizontal scrollback implementaiton --- st.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/st.c b/st.c index 50429fc..ca4c4b2 100644 --- a/st.c +++ b/st.c @@ -3030,7 +3030,13 @@ drawregion(int x1, int y1, int x2, int y2) continue; /* draw from horizontally scrolled position */ - xdrawline(&line[term.hscr], x1, y, MIN(x2, linelen - term.hscr)); + /* ensure we draw at least the visible width, limited by actual line content */ + int visible_width = MIN(x2, linelen - term.hscr); + if (visible_width < x2 && linelen > term.hscr) { + /* if line extends beyond what we calculated, draw more */ + visible_width = MIN(x2, MAX(visible_width, term.col)); + } + xdrawline(&line[term.hscr], x1, y, visible_width); } }