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

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

[nongnu] elpa/scroll-on-drag b1fdfb8d5a 1/2: Cleanup: formatting


From: ELPA Syncer
Subject: [nongnu] elpa/scroll-on-drag b1fdfb8d5a 1/2: Cleanup: formatting
Date: Mon, 9 Jan 2023 18:59:50 -0500 (EST)

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

    Cleanup: formatting
---
 scroll-on-drag.el | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index 342e3e545c..f48d4bbc2d 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -111,12 +111,11 @@ Argument DELTA-PX The number of pixels to scroll (signed).
 Argument ALSO-MOVE-POINT When non-nil, move the POINT as well."
   (cond
    ((< delta-px 0)
-    (let*
-        ((scroll-px-prev (- char-height (window-vscroll nil 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)))
-         (lines-remainder 0))
+    (let* ((scroll-px-prev (- char-height (window-vscroll nil 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)))
+           (lines-remainder 0))
       (unless (zerop lines)
         ;; flip
         (setq lines-remainder
@@ -179,8 +178,9 @@ VISUAL-LINE-DATA is the result of 
`scroll-on-drag--evil-visual-line-data'."
 (defun scroll-on-drag--impl ()
   "Interactively scroll (typically on click event).
 Returns true when scrolling took place, otherwise nil."
-  (let* (
-         ;; Don't run unnecessary logic when scrolling.
+  (let* ((scroll-timer nil)
+
+         ; Don't run unnecessary logic when scrolling.
          (inhibit-point-motion-hooks t)
          ;; Only draw explicitly once all actions have been done.
          (inhibit-redisplay t)
@@ -195,8 +195,6 @@ Returns true when scrolling took place, otherwise nil."
          ;; Doesn't reset (so we can detect clicks).
          (has-scrolled-real nil)
 
-         (scroll-timer nil)
-
          ;; Cursor offset.
          (delta 0)
          (delta-prev 0)
@@ -222,7 +220,8 @@ Returns true when scrolling took place, otherwise nil."
                        (- (window-body-height)
                           ;; When the point is at the window top,
                           ;; account for it being clamped while scrolling.
-                          (1+ (max scroll-margin (count-lines 
restore-window-start restore-point))))))
+                          (1+ (max scroll-margin
+                                   (count-lines restore-window-start 
restore-point))))))
                   (goto-char (point-max))
                   (forward-line (- lines))
                   (point))))))
@@ -260,11 +259,10 @@ Returns true when scrolling took place, otherwise nil."
                (copysign
                 ;; Clamp so converting to int won't fail.
                 (min 1e+18
-                     (*
-                      (expt
-                       (* f-abs scroll-on-drag-motion-scale)
-                       (+ 1.0 (* f-abs scroll-on-drag-motion-accelerate)))
-                      this-frame-char-height-as-float))
+                     (* (expt
+                         (* f-abs scroll-on-drag-motion-scale)
+                         (+ 1.0 (* f-abs scroll-on-drag-motion-accelerate)))
+                        this-frame-char-height-as-float))
                 f)))))
 
          ;; Calls 'timer-update-fn'.



reply via email to

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