1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Make pixel scrolling through images at the first line smoother

* lisp/better-pixel-scroll.el (better-pixel-scroll-scroll-up):
Try to reset vscroll if already vscrolled.
This commit is contained in:
Po Lu 2021-11-26 13:21:48 +08:00
parent fc8b87d904
commit 897a101cd3

View file

@ -88,10 +88,11 @@ the height of the current window."
(current-y (+ (cdr (posn-x-y posn))
(cdr (posn-object-width-height posn)))))
(while (< (- max-y current-y) delta)
(when (zerop (vertical-motion -1))
(set-window-vscroll nil 0)
(signal 'beginning-of-buffer nil))
(vertical-motion -1)
(setq current-y (- current-y (line-pixel-height)))))
(let ((current-vscroll (window-vscroll nil t)))
(setq delta (- delta current-vscroll))
(set-window-vscroll nil 0 t))
(while (> delta 0)
(set-window-start nil (save-excursion
(goto-char (window-start))