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

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

[nongnu] elpa/why-this d8db9e63e0 14/59: Fix overlay moving code and a t


From: ELPA Syncer
Subject: [nongnu] elpa/why-this d8db9e63e0 14/59: Fix overlay moving code and a typo in global-why-this-mode
Date: Sun, 27 Nov 2022 16:02:49 -0500 (EST)

branch: elpa/why-this
commit d8db9e63e077f55aaffe6c707fa6917c31994aa8
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Fix overlay moving code and a typo in global-why-this-mode
---
 why-this.el | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/why-this.el b/why-this.el
index 49c6b1852e..67b7827ced 100644
--- a/why-this.el
+++ b/why-this.el
@@ -269,14 +269,12 @@ When EXACT is non-nil, be as exact as possible."
                          (< line end)
                          (eq line (overlay-get (car ov) 'why-this-line)))))
              (progn
-               (let ((ov-start (overlay-start (car ov))))
-                 (when (and (eq (line-number-at-pos)
-                                (line-number-at-pos ov-start))
-                            (> (point) ov-start))
-                   (let ((pos (save-excursion
-                                (goto-char ov-start)
-                                (line-end-position))))
-                     (move-overlay (car ov) pos pos))))
+               (let* ((ov-start (overlay-start (car ov)))
+                      (pos (save-excursion
+                             (goto-char ov-start)
+                             (line-end-position))))
+                 (unless (eq ov-start pos)
+                   (move-overlay (car ov) pos pos)))
                ov)
            (delete-overlay (car ov))
            nil))
@@ -465,7 +463,7 @@ Actually the supported backend is returned."
 
 ;;;###autoload
 (define-globalized-minor-mode global-why-this-mode why-this-mode
-  #'why-this-mode)
+  why-this-mode)
 
 (define-derived-mode why-this-annotate-mode
   special-mode "Why-This-Annotate"



reply via email to

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