From 03dc54ba7fbd83e93b6841acbed14ae8ce319b7c Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 23 Dec 2021 21:26:59 +0800 Subject: [PATCH] Fix precision scrolling down for multi-line display strings * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page): Make sure Y delta is appropriate before deciding on next-pos. --- lisp/pixel-scroll.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 223bc7fbc47..975c5133f11 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -461,6 +461,11 @@ the height of the current window." (when (zerop (vertical-motion (1+ scroll-margin))) (set-window-start nil desired-start) (signal 'end-of-buffer nil)) + (while (when-let ((posn (posn-at-point))) + (< (cdr (posn-x-y posn)) delta)) + (when (zerop (vertical-motion 1)) + (set-window-start nil desired-start) + (signal 'end-of-buffer nil))) (point))) (scroll-preserve-screen-position nil) (auto-window-vscroll nil)) -- 2.39.2