branch: elpa/anzu
commit 24a2589f10f6a31d88b6ae36b6b7568bc3c9ab25
Merge: 4b9c6479d8 ef489aadb2
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>

    Merge pull request #23 from syohex/fix-replacement-issue
    
    Fix replacement issue(#22)
---
 anzu.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/anzu.el b/anzu.el
index 1f3227baa8..63ec15d2ff 100644
--- a/anzu.el
+++ b/anzu.el
@@ -385,11 +385,13 @@
       (insert from-string)
       (goto-char (point-min))
       (when (re-search-forward from-regexp nil t)
-        (if (consp compiled)
-            (replace-match (funcall (car compiled) (cdr compiled)
-                                    replacements) t)
-          (replace-match compiled t))
-        (buffer-substring (point-min) (point-max))))))
+        (or (ignore-errors
+              (if (consp compiled)
+                  (replace-match (funcall (car compiled) (cdr compiled)
+                                          replacements) t)
+                (replace-match compiled t))
+              (buffer-substring (point-min) (point-max)))
+            "")))))
 
 (defun anzu--overlay-sort (a b)
   (< (overlay-start a) (overlay-start b)))

Reply via email to