From 3c2afa66a217da84760849ed954245856f7e5810 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 28 Nov 2021 09:06:11 +0800 Subject: [PATCH] Make `pixel-scroll-precision-scroll-up' work better with overlays * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-up): Just set vscroll when on overlay. --- lisp/pixel-scroll.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 4280dc2587b..888320cf1ae 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -456,9 +456,14 @@ the height of the current window." (window-header-line-height)))) (desired-start (posn-point desired-pos)) (desired-vscroll (cdr (posn-object-x-y desired-pos)))) - (unless (eq (window-start) desired-start) - (set-window-start nil desired-start t)) - (set-window-vscroll nil desired-vscroll t)))))) + (let ((object (posn-object desired-pos))) + (if (or (consp object) (stringp object)) + (set-window-vscroll nil (+ (window-vscroll nil t) + (- delta)) + t) + (unless (eq (window-start) desired-start) + (set-window-start nil desired-start t)) + (set-window-vscroll nil desired-vscroll t)))))))) ;; FIXME: This doesn't work when there's an image above the current ;; line that is taller than the window. -- 2.39.2