]> git.eshelyaron.com Git - emacs.git/commitdiff
Make last change work for deltas that are multiples of max-height
authorPo Lu <luangruo@yahoo.com>
Sat, 4 Dec 2021 01:43:44 +0000 (09:43 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 4 Dec 2021 01:43:44 +0000 (09:43 +0800)
* 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

index 740aaf93c79e1fd394be955ef31f58706d535efa..207d34811aaab08e49e96973c5c0f18477cfaab7 100644 (file)
@@ -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)))