[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu dcae136088 173/288: Fix displaying current replaced p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu dcae136088 173/288: Fix displaying current replaced point |
Date: |
Thu, 6 Jan 2022 03:58:50 -0500 (EST) |
branch: elpa/anzu
commit dcae1360887947b36eb513bf7768037768acb4ed
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Fix displaying current replaced point
It does not work if replaced words are out of sight.
---
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 e53fe6d0fc 135/288: Bump up version and update Changes, (continued)
- [nongnu] elpa/anzu e53fe6d0fc 135/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 48eb310d24 139/288: Improve restoring point when canceling, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 2a3d8d76d2 141/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e567375313 142/288: Improve case when bounds-og-thing-at-point returns nil, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 67b98d6103 146/288: Improve calculation of current replacement position, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu c8f3e7b651 150/288: Merge pull request #35 from syohex/better-migemo-checking, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 962c425d39 149/288: Better checking whether using migemo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ffaf6b3c10 153/288: Add MELPA badges, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5b2ce629b7 154/288: Update MELPA links, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu d3650160d7 161/288: Don't search if input regexp is not valid yet., ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu dcae136088 173/288: Fix displaying current replaced point,
ELPA Syncer <=
- [nongnu] elpa/anzu e3aab048b4 168/288: Disable blink-matching-paren in read 'to' string, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b9bac0e2f8 178/288: Merge pull request #43 from syohex/fix-compile-regexp-error-case, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 1f7ac26191 189/288: Just call isearch-symbol-regexp instead of constructing own regexp, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 10bc7c5fbd 171/288: Merge pull request #41 from syohex/refactoring, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu db9e990940 179/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 8930374775 176/288: Fix case if s-expression cannot be compiled., ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ef39357f0a 188/288: Use variable instead of function call, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 95caf0f382 219/288: Merge pull request #63 from tarsius/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e2cb45487d 213/288: Merge pull request #60 from kosh04/fix-literal-replace, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b791609fe8 226/288: Update document, ELPA Syncer, 2022/01/06