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

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

[nongnu] elpa/focus 1423efbd25 42/82: Don't assume bounds are found


From: ELPA Syncer
Subject: [nongnu] elpa/focus 1423efbd25 42/82: Don't assume bounds are found
Date: Tue, 6 Sep 2022 04:58:56 -0400 (EDT)

branch: elpa/focus
commit 1423efbd255e574eafbd834d5ab7409218737c21
Author: Lars Tveito <larstvei@ifi.uio.no>
Commit: Lars Tveito <larstvei@ifi.uio.no>

    Don't assume bounds are found
---
 focus.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/focus.el b/focus.el
index 238673374b..578243ac34 100644
--- a/focus.el
+++ b/focus.el
@@ -167,8 +167,9 @@ deleted, and `focus-move-focus' is removed from 
`post-command-hook'."
   (interactive "p")
   (forward-thing (focus-get-thing) (+ 1 n))
   (let ((bounds (focus-bounds)))
-    (goto-char (/ (+ (car bounds) (cdr bounds)) 2)))
-  (recenter nil))
+    (when bounds
+      (goto-char (/ (+ (car bounds) (cdr bounds)) 2))
+      (recenter nil))))
 
 (defun focus-prev-thing (&optional n)
   "Moves the point to the middle of the Nth previous thing."



reply via email to

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