branch: elpa/anzu
commit ef489aadb206f995a9801328d74b752a52128482
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>
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)))