branch: elpa/scroll-on-jump
commit 4b11cda03947988167863b30d5810c2e98e79ee1
Author: Campbell Barton <[email protected]>
Commit: Campbell Barton <[email protected]>
Cleanup: pass the window to count-screen-lines
This is to be explicit, as the window will be the current window anyway.
---
scroll-on-jump.el | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/scroll-on-jump.el b/scroll-on-jump.el
index 7a3f1f3c42..b5292d5fd5 100644
--- a/scroll-on-jump.el
+++ b/scroll-on-jump.el
@@ -317,8 +317,7 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
(defun scroll-on-jump-auto-center (window point-prev point-next)
"Re-frame WINDOW from POINT-PREV to POINT-NEXT, optionally animating."
;; Count lines, excluding the current line.
-
- (let ((lines (1- (count-screen-lines point-prev point-next t))))
+ (let ((lines (1- (count-screen-lines point-prev point-next t window))))
(when (> lines 0)
(let
(
@@ -332,7 +331,7 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
(if (eq dir 1)
(let*
(
- (window-lines-prev (count-screen-lines (window-start window)
point-prev t))
+ (window-lines-prev (count-screen-lines (window-start window)
point-prev t window))
(window-lines-next (+ window-lines-prev lines))
(lines-limit (max (/ height 2) window-lines-prev)))
(when (>= window-lines-next lines-limit)
@@ -351,7 +350,7 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
( ;; Note that we can't use `window-end' here as we may
;; be scrolled past the screen end-point.
(window-lines-prev
- (- height (count-screen-lines (window-start window) point-prev
t)))
+ (- height (count-screen-lines (window-start window) point-prev
t window)))
(window-lines-next (+ window-lines-prev lines))
(lines-limit (max (/ height 2) window-lines-prev)))
(when (>= window-lines-next lines-limit)