branch: elpa/scroll-on-drag
commit 64e87d2dcd9069221f9953ef8c3ee8bb175f8bd9
Author: Campbell Barton <[email protected]>
Commit: Campbell Barton <[email protected]>

    Fix: window-vscroll wasn't forwarding the "window" argument
    
    If window was not the active window the scroll value could be invalid.
---
 scroll-on-drag.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index 8024897815a..36815a7c38e 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -140,7 +140,7 @@ ALSO-MOVE-POINT When non-nil, move the POINT as well."
   (declare (important-return-value nil))
   (cond
    ((< delta-px 0)
-    (let* ((scroll-px-prev (- char-height (window-vscroll nil t))) ; flip.
+    (let* ((scroll-px-prev (- char-height (window-vscroll window t))) ; flip.
            (scroll-px-next (+ scroll-px-prev (- delta-px))) ; flip.
            (lines (/ scroll-px-next char-height))
            (scroll-px (- scroll-px-next (* lines char-height)))
@@ -154,7 +154,7 @@ ALSO-MOVE-POINT When non-nil, move the POINT as well."
       (set-window-vscroll window (- char-height scroll-px) t)
       (- lines-remainder)))
    ((> delta-px 0)
-    (let* ((scroll-px-prev (window-vscroll nil t))
+    (let* ((scroll-px-prev (window-vscroll window t))
            (scroll-px-next (+ scroll-px-prev delta-px))
            (lines (/ scroll-px-next char-height))
            (scroll-px (- scroll-px-next (* lines char-height)))

Reply via email to