branch: elpa/anzu
commit 7fb133e847f313075e15df823a30f951af97b777
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>
Fix zero width replacement such as '^'(#44)
---
anzu.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/anzu.el b/anzu.el
index fb585b171b..e0f2ba0fd6 100644
--- a/anzu.el
+++ b/anzu.el
@@ -636,7 +636,13 @@
(cl-loop with curbuf = (current-buffer)
with search-func = (if use-regexp 're-search-forward
'search-forward)
while (funcall search-func from end t)
- do (anzu--set-marker (match-beginning 0) curbuf))))
+ do
+ (progn
+ (anzu--set-marker (match-beginning 0) curbuf)
+ (when (= (match-beginning 0) (match-end 0))
+ (if (eobp)
+ (cl-return nil)
+ (forward-char 1)))))))
(cl-defun anzu--query-replace-common (use-regexp &key at-cursor thing
prefix-arg (query t))
(anzu--cons-mode-line 'replace-query)