branch: elpa/anzu
commit 13401ab3c6783776e5a15e7bf14d0f4e7b163db4
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>
Don't search over bound
---
anzu.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/anzu.el b/anzu.el
index 6e1eb8785b..577474eb27 100644
--- a/anzu.el
+++ b/anzu.el
@@ -388,6 +388,8 @@
(if (eobp)
(setq finish t)
(forward-char 1)))
+ (when (and replace-end (> (point) replace-end))
+ (setq finish t))
(when (and (>= beg overlay-beg) (<= end overlay-end) (not
finish))
(cl-incf overlayed)
(anzu--add-overlay beg end))))
@@ -723,7 +725,9 @@
(when (= (match-beginning 0) (match-end 0))
(if (eobp)
(cl-return nil)
- (forward-char 1)))))))
+ (forward-char 1)))
+ (when (and end (> (point) end))
+ (cl-return nil))))))
(cl-defun anzu--query-replace-common (use-regexp
&key at-cursor thing prefix-arg (query
t) isearch-p)