[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scroll-on-jump 42329b5707 20/31: Fix visual glitch when us
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scroll-on-jump 42329b5707 20/31: Fix visual glitch when used with next/previous line |
Date: |
Thu, 7 Jul 2022 12:03:13 -0400 (EDT) |
branch: elpa/scroll-on-jump
commit 42329b570756a7f4a65155d38a46f61b905b7333
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Fix visual glitch when used with next/previous line
---
scroll-on-jump.el | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/scroll-on-jump.el b/scroll-on-jump.el
index 996d3d7b6c..5131ffdeec 100644
--- a/scroll-on-jump.el
+++ b/scroll-on-jump.el
@@ -217,8 +217,11 @@ Moving the point when ALSO-MOVE-POINT is set."
(setq lines-scroll (- lines-scroll step)))
- ;; Force `redisplay', without this redrawing can be a little
choppy.
- (redisplay t))
+ ;; Skip the last redraw, so there isn't 2x update when
+ ;; the caller moves the point to the final location.
+ (when (< lines-done-abs lines-scroll-abs)
+ ;; Force `redisplay', without this redrawing can be a little
choppy.
+ (redisplay t)))
(setq is-early-exit nil))
;; ;; Re-enable when editing logic.
@@ -308,8 +311,11 @@ Argument ALSO-MOVE-POINT moves the point while scrolling."
(setq px-scroll (- px-scroll step)))
- ;; Force `redisplay', without this redrawing can be a little
choppy.
- (redisplay t))
+ ;; Skip the last redraw, so there isn't 2x update when
+ ;; the caller moves the point to the final location.
+ (when (< px-done-abs px-scroll-abs)
+ ;; Force `redisplay', without this redrawing can be a little
choppy.
+ (redisplay t)))
(setq is-early-exit nil))
(cond
@@ -343,7 +349,14 @@ Moving the point when ALSO-MOVE-POINT is set."
((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))
+ ;;
+ ;; NOTE: only pixel scroll >1 lines so actions that move the cursor
up/down one
+ ;; don't attempt to smooth scroll.
+ ;; While this works without problems, it does cause a flicker redrawing
the point.
+ ;; Harmless but seems like a glitch if `scroll-on-jump' is being applied to
+ ;; `next-line' or `previous-line'.
+ ;; So it's simplest not to use smooth scroll in this particular case.
+ ((and scroll-on-jump-smooth (display-graphic-p) (> 1 (abs lines-scroll)))
(scroll-on-jump--animated-scroll-by-px window lines-scroll dir
also-move-point))
;; Use line scrolling.
(t
@@ -470,7 +483,8 @@ Argument USE-WINDOW-START detects window scrolling when
non-nil."
-1))
(also-move-point (not (eq (point) point-next))))
(scroll-on-jump--scroll-impl window (* dir lines-scroll)
dir also-move-point)))
- (goto-char point-next))
+ (prog1 (goto-char point-next)
+ (redisplay t)))
(scroll-on-jump-auto-center window point-prev point-next))))))))
- [nongnu] branch elpa/scroll-on-jump created (now 8fde237ae6), ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 4b11cda039 07/31: Cleanup: pass the window to count-screen-lines, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 94986120c4 08/31: readme: add link to demo video, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump fddbdfdfe0 11/31: Fix error where the pixel scroll was left a non-zero value, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 42329b5707 20/31: Fix visual glitch when used with next/previous line,
ELPA Syncer <=
- [nongnu] elpa/scroll-on-jump 5007e9ea8a 18/31: readme: add examples suggested in #2, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 69c86542a1 15/31: Docs: add docstrings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump dd2818d906 17/31: Cleanup: make docstring under 80 chars, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 30dc5f5e50 21/31: Cleanup: remove recursion check, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 28bac2cdc3 22/31: Cleanup: quiet checkdoc warnings for wide docstrings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 0ce93b3ea6 19/31: readme: remove 'evil-goto-first-line' as 'evil-goto-line' already scrolls, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 000dc41039 25/31: Fix error passing out-of-range point to count-screen-lines, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 99386fc01b 30/31: Cleanup: use brief SPDX license, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 556e9a7a81 28/31: Fix error detecting scroll changes, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-jump 9767013ca8 13/31: Support wrapping functions that themselves scroll, ELPA Syncer, 2022/07/07