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.
This commit is contained in:
Po Lu 2021-11-28 09:06:11 +08:00
parent 338f780237
commit 3c2afa66a2

View file

@ -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.