emacs-diffs
[Top][All Lists]
Advanced

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

master 541f61b: Avoid unnecessary call when pixel scrolling


From: Po Lu
Subject: master 541f61b: Avoid unnecessary call when pixel scrolling
Date: Tue, 30 Nov 2021 22:23:50 -0500 (EST)

branch: master
commit 541f61b378eca85fa118caff5ad97b56171baa98
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Avoid unnecessary call when pixel scrolling
    
    * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down):
    Avoid unnecessary call to `posn-at-point'
---
 lisp/pixel-scroll.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index f514a01..6567153 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -388,13 +388,14 @@ the height of the current window."
                      (point))))
     (if (and (< (point) next-pos)
              (let ((pos-visibility (pos-visible-in-window-p next-pos nil t)))
-               (or (eq (length pos-visibility) 2)
-                   (when-let* ((posn (posn-at-point next-pos))
-                               (edges (window-edges nil t))
-                               (usable-height (- (nth 3 edges)
-                                                 (nth 1 edges))))
-                     (> (cdr (posn-object-width-height posn))
-                        usable-height)))))
+               (and pos-visibility
+                    (or (eq (length pos-visibility) 2)
+                        (when-let* ((posn (posn-at-point next-pos))
+                                    (edges (window-edges nil t))
+                                    (usable-height (- (nth 3 edges)
+                                                      (nth 1 edges))))
+                          (> (cdr (posn-object-width-height posn))
+                             usable-height))))))
         (goto-char next-pos))
     (if (or (consp object) (stringp object))
         ;; We are either on an overlay or a string, so set vscroll



reply via email to

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