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

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

[nongnu] elpa/scroll-on-jump 1e9e09f0cc 29/31: Fix error counting lines


From: ELPA Syncer
Subject: [nongnu] elpa/scroll-on-jump 1e9e09f0cc 29/31: Fix error counting lines jumping to a point outside buffer range
Date: Thu, 7 Jul 2022 12:03:16 -0400 (EDT)

branch: elpa/scroll-on-jump
commit 1e9e09f0ccadf805e9bb4dbd1050944f82c5ed0f
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Fix error counting lines jumping to a point outside buffer range
---
 scroll-on-jump.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scroll-on-jump.el b/scroll-on-jump.el
index 3e5245c005..d2d9ab86a0 100644
--- a/scroll-on-jump.el
+++ b/scroll-on-jump.el
@@ -502,6 +502,12 @@ Argument USE-WINDOW-START detects window scrolling when 
non-nil."
           (goto-char point-next))
 
         (t ;; Perform animated scroll.
+
+          ;; It's possible the requested `point-next' exceeds the maximum 
point.
+          ;; This causes an error counting lines and calculating offsets,
+          ;; so clamp it here to avoid complications later.
+          (setq point-next (min point-next (point-max)))
+
           (cond
             (,use-window-start
               (setq window-start-next (window-start window))



reply via email to

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