branch: elpa/anzu
commit be16738cb79d2faa887fa5df88575809f7c3bcba
Merge: 3845ead349 13401ab3c6
Author: Syohei YOSHIDA <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #80 from syohex/replace-with-region
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)