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

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

[nongnu] elpa/iedit 95e7731a91 147/301: bugfix for when there are no occ


From: ELPA Syncer
Subject: [nongnu] elpa/iedit 95e7731a91 147/301: bugfix for when there are no occurrences
Date: Mon, 10 Jan 2022 22:58:58 -0500 (EST)

branch: elpa/iedit
commit 95e7731a91d17ca1542af67f4e51b9492c32ff6e
Author: mbneedham <mbneedham@gmail.com>
Commit: mbneedham <mbneedham@gmail.com>

    bugfix for when there are no occurrences
---
 iedit-lib.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/iedit-lib.el b/iedit-lib.el
index fcc78bbb56..a2174d8793 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -769,12 +769,14 @@ This function is supposed to be called in overlay keymap."
 (defun iedit-current-occurrence-string ()
   "Return current occurrence string.
 Return nil if occurrence string is empty string."
-  (let* ((ov (or (iedit-find-current-occurrence-overlay)
-                 (car iedit-occurrences-overlays)))
-         (beg (overlay-start ov))
-         (end (overlay-end ov)))
-    (if (and ov (/=  beg end))
-        (buffer-substring-no-properties beg end)
+  (let ((ov (or (iedit-find-current-occurrence-overlay)
+                 (car iedit-occurrences-overlays))))
+    (if ov
+        (let ((beg (overlay-start ov))
+              (end (overlay-end ov)))
+          (if (and ov (/=  beg end))
+              (buffer-substring-no-properties beg end)
+            nil))
       nil)))
 
 (defun iedit-occurrence-string-length ()



reply via email to

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