emacs-diffs
[Top][All Lists]
Advanced

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

master be13598: Make last change work for deltas that are multiples of m


From: Po Lu
Subject: master be13598: Make last change work for deltas that are multiples of max-height
Date: Fri, 3 Dec 2021 20:44:52 -0500 (EST)

branch: master
commit be1359884f68a3c8f8041be5579e6c5268d42d9a
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Make last change work for deltas that are multiples of max-height
    
    * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page)
    (pixel-scroll-precision-scroll-up-page): Use `max-height' that
    is slightly less than the text height of the window.
---
 lisp/pixel-scroll.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 740aaf9..207d348 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -439,7 +439,8 @@ the height of the current window."
 
 (defun pixel-scroll-precision-scroll-down (delta)
   "Scroll the current window down by DELTA pixels."
-  (let ((max-height (window-text-height nil t)))
+  (let ((max-height (- (window-text-height nil t)
+                       (frame-char-height))))
     (while (> delta max-height)
       (pixel-scroll-precision-scroll-down-page max-height)
       (setq delta (- delta max-height)))
@@ -499,7 +500,8 @@ the height of the current window."
 
 (defun pixel-scroll-precision-scroll-up (delta)
   "Scroll the current window up by DELTA pixels."
-  (let ((max-height (window-text-height nil t)))
+  (let ((max-height (- (window-text-height nil t)
+                       (frame-char-height))))
     (while (> delta max-height)
       (pixel-scroll-precision-scroll-up-page max-height)
       (setq delta (- delta max-height)))



reply via email to

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