[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu 8a1eb22317 174/288: Merge pull request #42 from syohe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu 8a1eb22317 174/288: Merge pull request #42 from syohex/fix-replace-command-bug |
Date: |
Thu, 6 Jan 2022 03:58:50 -0500 (EST) |
branch: elpa/anzu
commit 8a1eb22317a45594b21039c6085c71f5f031c5f7
Merge: b723c16507 dcae136088
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Merge pull request #42 from syohex/fix-replace-command-bug
Fix displaying current replaced point
---
anzu.el | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/anzu.el b/anzu.el
index 3c9c2498fe..a92067557b 100644
--- a/anzu.el
+++ b/anzu.el
@@ -350,7 +350,6 @@
(forward-char 1)))
(when (and (>= beg overlay-beg) (<= end overlay-end) (not
finish))
(cl-incf overlayed)
- (anzu--set-marker beg buf)
(anzu--add-overlay beg end))))
(setq anzu--cached-count count)
overlayed))))))
@@ -615,7 +614,7 @@
(defsubst anzu--current-replaced-index (curpoint)
(cl-loop for m in anzu--replaced-markers
- for i = 1 then (+ i 1)
+ for i = 1 then (1+ i)
for pos = (marker-position m)
when (= pos curpoint)
return i))
@@ -627,6 +626,14 @@
(force-mode-line-update)
(setq anzu--current-position (or index 1))))))
+(defun anzu--set-replaced-markers (from beg end use-regexp)
+ (save-excursion
+ (goto-char beg)
+ (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))))
+
(cl-defun anzu--query-replace-common (use-regexp &key at-cursor thing
prefix-arg (query t))
(anzu--cons-mode-line 'replace-query)
(let* ((use-region (use-region-p))
@@ -654,6 +661,7 @@
(anzu--query-replace-read-to
from prompt beg end use-regexp overlay-limit))))
(anzu--clear-overlays curbuf beg end)
+ (anzu--set-replaced-markers from beg end use-regexp)
(setq anzu--state 'replace anzu--current-position 0
anzu--replaced-markers (reverse anzu--replaced-markers)
clear-overlay t)
@@ -668,6 +676,7 @@
(anzu--clear-overlays curbuf beg end))
(when (zerop anzu--current-position)
(goto-char orig-point))
+ (anzu--cleanup-markers)
(anzu--reset-mode-line)
(force-mode-line-update)))))
- [nongnu] elpa/anzu 630d663238 087/288: Fix invalid return type, (continued)
- [nongnu] elpa/anzu 630d663238 087/288: Fix invalid return type, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 9b772435ea 090/288: Support backward replace, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 81b4eb6e29 093/288: Fix increasing anzu information in mode-line issue(#13), ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 1ea6980019 106/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu caf83591e4 134/288: Merge pull request #28 from syohex/improve-replace-mode-line, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5d209726cd 156/288: Merge pull request #36 from syohex/case-sensitive-for-at-cursor-command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ee53798dc2 160/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 1c2705bb2c 164/288: Merge pull request #38 from syohex/improve-replacement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu d4dcd76f47 190/288: Merge pull request #48 from syohex/improve-history, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 370b9f162f 181/288: Merge pull request #45 from syohex/fix-zero-width-replacement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 8a1eb22317 174/288: Merge pull request #42 from syohex/fix-replace-command-bug,
ELPA Syncer <=
- [nongnu] elpa/anzu a1f56b6dad 193/288: Merge pull request #50 from syohex/fix-default-input-49, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 6dd966b4e2 186/288: Implement separator feature of Emacs 25, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5e87e8c07a 187/288: Use own history variable for maintenance, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 10a05eb50c 166/288: Disable blink-matching-paren for improvement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5abdc5b889 038/288: Update document, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 0418c2b6d4 041/288: Update document, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 218a63ce47 015/288: Highlight code and add screenshot explanation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 7b3d95d495 183/288: Support Emacs 24 and 25, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 6b217a457f 182/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 3c178f75f3 197/288: Fix matching a literal string, ELPA Syncer, 2022/01/06