emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4d6511a: Fix automatic hscrolling when line numbers are displayed


From: Eli Zaretskii
Subject: master 4d6511a: Fix automatic hscrolling when line numbers are displayed
Date: Fri, 6 Aug 2021 03:52:35 -0400 (EDT)

branch: master
commit 4d6511a2842ee92271b0ddc4572cb2a801a172a5
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix automatic hscrolling when line numbers are displayed
    
    * src/xdisp.c (hscroll_window_tree): When line numbers are
    displayed, account for the the line-number space when calculating
    the desired X coordinate on the left.  (Bug#49891)
---
 src/xdisp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 70d15ae..e62f7e3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -15082,11 +15082,12 @@ hscroll_window_tree (Lisp_Object window)
              else
                {
                  if (hscroll_relative_p)
-                   wanted_x = text_area_width * hscroll_step_rel
-                              + h_margin;
+                   wanted_x =
+                     text_area_width * hscroll_step_rel + h_margin + x_offset;
                  else
-                   wanted_x = hscroll_step_abs * FRAME_COLUMN_WIDTH (it.f)
-                              + h_margin;
+                   wanted_x =
+                     hscroll_step_abs * FRAME_COLUMN_WIDTH (it.f)
+                     + h_margin + x_offset;
                  hscroll
                    = max (0, it.current_x - wanted_x) / FRAME_COLUMN_WIDTH 
(it.f);
                }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]