]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix scrolling window when point moves up
authorShynur <one.last.kiss@outlook.com>
Wed, 29 Mar 2023 17:29:17 +0000 (01:29 +0800)
committerEli Zaretskii <eliz@gnu.org>
Thu, 30 Mar 2023 06:43:00 +0000 (09:43 +0300)
This fixes the case when both 'scroll-conservatively' and
'scroll-step' are customized to non-default values.
* src/xdisp.c (try_scrolling): Fix precedence between
'scroll-step' and 'scroll-conservatively' when scrolling with
'previous-line'.  (Bug#62530)

Copyright-paperwork-exempt: yes

src/xdisp.c

index 0b1905294048348d25c502696d4e36ba83262cd2..8e265fb5a49f7aec5aac06b3afa3b14fce9d87f3 100644 (file)
@@ -18546,8 +18546,9 @@ try_scrolling (Lisp_Object window, bool just_this_one_p,
          start_display (&it, w, startp);
 
          if (arg_scroll_conservatively)
-           amount_to_scroll = max (dy, frame_line_height
-                                   * max (scroll_step, temp_scroll_step));
+           amount_to_scroll
+             = min (max (dy, frame_line_height),
+                    frame_line_height * arg_scroll_conservatively);
          else if (scroll_step || temp_scroll_step)
            amount_to_scroll = scroll_max;
          else