Fix pixel scrolling again
authorPo Lu <luangruo@yahoo.com>
Tue, 30 Nov 2021 12:49:59 +0000 (20:49 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 30 Nov 2021 12:49:59 +0000 (20:49 +0800)
* lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down): Fix
confusion about absolutivity of `window-edges'.

lisp/pixel-scroll.el

index cc90be021f7c6df3f9421c741e64f8b492dbdfbc..5ffa8caa71c878a7a62de507f1d07e2835b7696e 100644 (file)
@@ -424,10 +424,11 @@ the height of the current window."
 (defun pixel-scroll-precision-scroll-up (delta)
   "Scroll the current window up by DELTA pixels."
   (let* ((edges (window-edges nil t nil t))
-         (max-y (- (nth 3 edges) 1
+         (max-y (- (nth 3 edges)
+                   (nth 1 edges)
                    (window-tab-line-height)
                    (window-header-line-height)))
-         (usable-height (- max-y (nth 1 edges))))
+         (usable-height max-y))
     (when-let* ((posn (posn-at-point))
                (current-y (+ (cdr (posn-x-y posn))
                              (line-pixel-height))))