diff options
author | Po Lu <luangruo@yahoo.com> | 2021-12-04 09:43:44 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2021-12-04 09:43:44 +0800 |
commit | be1359884f68a3c8f8041be5579e6c5268d42d9a (patch) | |
tree | 3af7601c619de33abef4e5f7d1e0a1a6766a05e3 /lisp/pixel-scroll.el | |
parent | 1450fa16ed9ae41993ff32db51f380e3c99c908e (diff) | |
download | emacs-be1359884f68a3c8f8041be5579e6c5268d42d9a.tar.gz |
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.
Diffstat (limited to 'lisp/pixel-scroll.el')
-rw-r--r-- | lisp/pixel-scroll.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 740aaf93c79..207d34811aa 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))) |