emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 8eb6870: Fix vertical cursor motion in pixel-scro


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 8eb6870: Fix vertical cursor motion in pixel-scroll.el
Date: Fri, 1 Dec 2017 03:57:44 -0500 (EST)

branch: emacs-26
commit 8eb6870be690128fb1cbc012c55093813c39830c
Author: Tak Kunihiro <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix vertical cursor motion in pixel-scroll.el
    
    * lisp/pixel-scroll.el (pixel-scroll-up): Move cursor down
    regardless of whether EOB is shown at the top.
    (pixel-scroll-down) Move cursor up regardless of whether BOB
    is shown at the top.  (Bug#29374)
---
 lisp/pixel-scroll.el | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 9bfe5c9..f64a439 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -110,11 +110,11 @@ This is an alternative of `scroll-up'.  Scope moves 
downward."
                        pixel-resolution-fine-flag
                      (frame-char-height))
                  (pixel-line-height))))
-      (if (pixel-eob-at-top-p)            ; when end-of-the-buffer is close
-          (scroll-up 1)                   ; relay on robust method
-        (while (pixel-point-at-top-p amt) ; prevent too late (multi tries)
-          (vertical-motion 1))            ; move point downward
-        (pixel-scroll-pixel-up amt)))))   ; move scope downward
+      (while (pixel-point-at-top-p amt) ; prevent too late (multi tries)
+        (vertical-motion 1))            ; move point downward
+      (if (pixel-eob-at-top-p)          ; when end-of-the-buffer is close
+          (scroll-up 1)                 ; relay on robust method
+        (pixel-scroll-pixel-up amt))))) ; move scope downward
 
 (defun pixel-scroll-down (&optional arg)
   "Scroll text of selected window down ARG lines.
@@ -127,11 +127,11 @@ This is and alternative of `scroll-down'.  Scope moves 
upward."
                        pixel-resolution-fine-flag
                      (frame-char-height))
                  (pixel-line-height -1))))
-      (if (or (pixel-bob-at-top-p amt) ; when beginning-of-the-buffer is seen
-              (pixel-eob-at-top-p))    ; for file with a long line
-          (scroll-down 1)              ; relay on robust method
-        (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries)
-          (vertical-motion -1))
+      (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries)
+        (vertical-motion -1))              ; move point upward
+      (if (or (pixel-bob-at-top-p amt)     ; when beginning-of-the-buffer is 
seen
+              (pixel-eob-at-top-p))        ; for file with a long line
+          (scroll-down 1)                  ; relay on robust method
         (pixel-scroll-pixel-down amt)))))
 
 (defun pixel-bob-at-top-p (amt)



reply via email to

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