[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scroll-on-jump 055144ca83 12/31: Disable moving the point
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scroll-on-jump 055144ca83 12/31: Disable moving the point when the destination point doesn't move |
Date: |
Thu, 7 Jul 2022 12:03:12 -0400 (EDT) |
branch: elpa/scroll-on-jump
commit 055144ca8331c8bfca7f13498a1be8d798f5384d
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Disable moving the point when the destination point doesn't move
---
scroll-on-jump.el | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/scroll-on-jump.el b/scroll-on-jump.el
index 6d57efd3a3..640be27ee0 100644
--- a/scroll-on-jump.el
+++ b/scroll-on-jump.el
@@ -159,7 +159,7 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
"Non animated scroll for WINDOW to move LINES-SCROLL."
(scroll-on-jump--scroll-by-lines-simple window lines-scroll nil))
-(defun scroll-on-jump--animated-scroll-by-line (window lines-scroll dir)
+(defun scroll-on-jump--animated-scroll-by-line (window lines-scroll dir
also-move-point)
"Animated scroll WINDOW LINES-SCROLL lines along DIR direction."
(let
(
@@ -210,7 +210,9 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
;; Faster alternative to scroll.
(scroll-on-jump--scroll-by-lines-simple window step nil)
- (forward-line step)
+
+ (when also-move-point
+ (forward-line step))
(setq lines-scroll (- lines-scroll step)))
@@ -231,7 +233,7 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
(run-window-scroll-functions window))
-(defun scroll-on-jump--animated-scroll-by-px (window lines-scroll dir)
+(defun scroll-on-jump--animated-scroll-by-px (window lines-scroll dir
also-move-point)
"Animated scroll WINDOW LINES-SCROLL lines along DIR direction."
(let
(
@@ -260,7 +262,8 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
;; This is only needed for pixel level scrolling.
;;
;; We can move arbitrary lines here since the final point is set at
the very end.
- (forward-line dir)
+ (when also-move-point
+ (forward-line dir))
(while-no-input
(while (< px-done-abs px-scroll-abs)
@@ -296,7 +299,8 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
;; Forward lines separately since we might be at end of the
buffer
;; and we want to be able to scroll - even if the point has
reached it's limit.
- (forward-line lines-handled)
+ (when also-move-point
+ (forward-line lines-handled))
(setq lines-scroll (- lines-scroll lines-handled)))
@@ -328,17 +332,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)
+(defun scroll-on-jump--scroll-impl (window lines-scroll dir also-move-point)
(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))
+ (scroll-on-jump--animated-scroll-by-px window lines-scroll dir
also-move-point))
;; Use line scrolling.
(t
- (scroll-on-jump--animated-scroll-by-line window lines-scroll dir))))
+ (scroll-on-jump--animated-scroll-by-line window lines-scroll dir
also-move-point))))
(defun scroll-on-jump-auto-center (window point-prev point-next)
"Re-frame WINDOW from POINT-PREV to POINT-NEXT, optionally animating."
@@ -393,7 +397,7 @@ Argument ALSO-MOVE-POINT When non-nil, move the POINT as
well."
(goto-char (window-start window))
(forward-line lines-scroll)))))))
- (scroll-on-jump--scroll-impl window lines-scroll dir))))
+ (scroll-on-jump--scroll-impl window lines-scroll dir (not (eq (point)
point-next))))))
(goto-char point-next))
- [nongnu] elpa/scroll-on-jump 7b2919f8d8 27/31: Fix smooth (pixel) scrolling not being used in most cases, (continued)
- [nongnu] elpa/scroll-on-jump 7b2919f8d8 27/31: Fix smooth (pixel) scrolling not being used in most cases, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 1f2349edf4 04/31: Fix scrolling down when the point is at the beginning of the buffer, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump e8b79d35d4 09/31: Cleanup: split scroll-on-jump--scroll-impl into it's own function, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 028e672391 03/31: Cleanup: no need for `let*`, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump eb77ab1920 02/31: readme: add a more complete example, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 9c333320ea 05/31: Don't catch and re-raise errors, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 7a51468bdd 14/31: Cleanup: declare variable, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 0cf26a15bb 26/31: Cleanup: use window-body-height, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump df8b208ba7 16/31: readme: add melpa link, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump ea74496fa1 10/31: Fix recursive calls to animate scrolling, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 055144ca83 12/31: Disable moving the point when the destination point doesn't move,
ELPA Syncer <=
- [nongnu] elpa/scroll-on-jump 30e23e8694 01/31: Initial commit, ELPA Syncer, 2022/07/07