From 4936db1abb4137046cdd02d9be568c3e16d241cb Mon Sep 17 00:00:00 2001 From: Erik van Zwol Date: Sun, 21 Aug 2022 21:36:11 -0600 Subject: [PATCH] ; * src/xdisp.c (hscroll_window_tree): hscroll current-line fix --- src/xdisp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 0248e8e53f..6719a858f7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15888,7 +15888,11 @@ hscroll_window_tree (Lisp_Object window) : (text_area_width / 2)))) / FRAME_COLUMN_WIDTH (it.f); else if ((!row_r2l_p - && w->cursor.x >= text_area_width - h_margin) + && (w->cursor.x >= text_area_width - h_margin + /* When hscrolling only the current line and the current line + is less than (text_area_width - h_margin), it might be hscrolled + almost completely off the left side unless we catch it here. */ + || hscl)) || (row_r2l_p && w->cursor.x <= h_margin)) { if (hscroll_relative_p) -- 2.25.1