emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/scroll-on-jump e8b79d35d4 09/31: Cleanup: split scroll-on-


From: ELPA Syncer
Subject: [nongnu] elpa/scroll-on-jump e8b79d35d4 09/31: Cleanup: split scroll-on-jump--scroll-impl into it's own function
Date: Thu, 7 Jul 2022 12:03:12 -0400 (EDT)

branch: elpa/scroll-on-jump
commit e8b79d35d458e7350904e86dd214930204b14ef8
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Cleanup: split scroll-on-jump--scroll-impl into it's own function
    
    Needed for resolving #1
---
 scroll-on-jump.el | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/scroll-on-jump.el b/scroll-on-jump.el
index b5292d5fd5..6925bc72f4 100644
--- a/scroll-on-jump.el
+++ b/scroll-on-jump.el
@@ -313,6 +313,17 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as 
well."
 
   (run-window-scroll-functions window))
 
+(defun scroll-on-jump--scroll-impl (window lines-scroll dir)
+  (cond
+    ;; No animation.
+    ((zerop scroll-on-jump-duration)
+      (scroll-on-jump--immediate-scroll window lines-scroll dir))
+    ;; Use pixel scrolling.
+    ((and scroll-on-jump-smooth (display-graphic-p))
+      (scroll-on-jump--animated-scroll-by-px window lines-scroll dir))
+    ;; Use line scrolling.
+    (t
+      (scroll-on-jump--animated-scroll-by-line window lines-scroll dir))))
 
 (defun scroll-on-jump-auto-center (window point-prev point-next)
   "Re-frame WINDOW from POINT-PREV to POINT-NEXT, optionally animating."
@@ -367,16 +378,7 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as 
well."
                     (goto-char (window-start window))
                     (forward-line lines-scroll)))))))
 
-        (cond
-          ;; No animation.
-          ((zerop scroll-on-jump-duration)
-            (scroll-on-jump--immediate-scroll window lines-scroll dir))
-          ;; Use pixel scrolling.
-          ((and scroll-on-jump-smooth (display-graphic-p))
-            (scroll-on-jump--animated-scroll-by-px window lines-scroll dir))
-          ;; Use line scrolling.
-          (t
-            (scroll-on-jump--animated-scroll-by-line window lines-scroll 
dir))))))
+        (scroll-on-jump--scroll-impl window lines-scroll dir))))
 
   (goto-char point-next))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]