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

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

[nongnu] elpa/symbol-overlay dd061fff9c 1/2: Fix symbol-overlay-get-list


From: ELPA Syncer
Subject: [nongnu] elpa/symbol-overlay dd061fff9c 1/2: Fix symbol-overlay-get-list.
Date: Mon, 2 Jan 2023 04:59:54 -0500 (EST)

branch: elpa/symbol-overlay
commit dd061fff9c3bfc45111eef0746ab02b02d6590b9
Author: ksqsf <i@ksqsf.moe>
Commit: ksqsf <i@ksqsf.moe>

    Fix symbol-overlay-get-list.
    
    The previous version is incorrect when dir = 0.
---
 symbol-overlay.el | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/symbol-overlay.el b/symbol-overlay.el
index ff14ee5006..fa6512dd05 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -236,20 +236,19 @@ You can re-bind the commands to any keys you prefer.")
 If SYMBOL is non-nil, get the overlays that belong to it.
 DIR is an integer.
 If EXCLUDE is non-nil, get all overlays excluding those belong to SYMBOL."
-  (if (= dir 0)
-      (overlays-in (point-min) (point-max))
-    (let ((overlays (cond ((< dir 0) (overlays-in (point-min) (point)))
-                          ((> dir 0) (overlays-in (point) (point-max))))))
-      (seq-filter
-       (lambda (ov)
-         (let ((value (overlay-get ov 'symbol))
-               (end (overlay-end ov)))
-           (and value
-                (or (> dir 0) (< end (point)))
-                (or (not symbol)
-                    (if (string= value symbol) (not exclude)
-                      (and exclude (not (string= value ""))))))))
-       overlays))))
+  (let ((overlays (cond ((= dir 0) (overlays-in (point-min) (point-max)))
+                        ((< dir 0) (overlays-in (point-min) (point)))
+                        ((> dir 0) (overlays-in (point) (point-max))))))
+    (seq-filter
+     (lambda (ov)
+       (let ((value (overlay-get ov 'symbol))
+             (end (overlay-end ov)))
+         (and value
+              (or (>= dir 0) (< end (point)))
+              (or (not symbol)
+                  (if (string= value symbol) (not exclude)
+                    (and exclude (not (string= value ""))))))))
+     overlays)))
 
 (defun symbol-overlay-get-symbol (&optional noerror)
   "Get the symbol at point.



reply via email to

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