[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu cb70e6c611 145/288: Fix wrong counting total matched
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu cb70e6c611 145/288: Fix wrong counting total matched number when used default input |
Date: |
Thu, 6 Jan 2022 03:58:47 -0500 (EST) |
branch: elpa/anzu
commit cb70e6c6111a9b1f6b0f5ff7bf71ce31ab7c9941
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Fix wrong counting total matched number when used default input
---
anzu.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/anzu.el b/anzu.el
index e36a089654..2cc7de8768 100644
--- a/anzu.el
+++ b/anzu.el
@@ -131,6 +131,7 @@
(defvar anzu--cached-count 0)
(defvar anzu--last-replace-input "")
(defvar anzu--last-search-state nil)
+(defvar anzu--last-replaced-count nil)
(defvar anzu--outside-point nil)
(defun anzu--validate-regexp (regexp)
@@ -401,8 +402,11 @@
(sit-for 2))))
(defun anzu--query-from-string (prompt beg end use-regexp overlay-limit)
- (let ((from (anzu--read-from-string prompt beg end use-regexp
overlay-limit)))
- (if (and (string= from "") query-replace-defaults)
+ (let* ((from (anzu--read-from-string prompt beg end use-regexp
overlay-limit))
+ (is-empty (string= from "")))
+ (when (and (not is-empty) (not query-replace-defaults))
+ (setq anzu--last-replaced-count anzu--total-matched))
+ (if (and is-empty query-replace-defaults)
(cons (car query-replace-defaults)
(query-replace-compile-replacement
(cdr query-replace-defaults) use-regexp))
@@ -604,7 +608,9 @@
(anzu--query-from-at-cursor curbuf beg end
overlay-limit))
(anzu--query-from-string prompt beg end use-regexp
overlay-limit)))
(to (if (consp from)
- (prog1 (cdr from) (setq from (car from)))
+ (prog1 (cdr from)
+ (setq from (car from)
+ anzu--total-matched anzu--last-replaced-count))
(anzu--query-replace-read-to
from prompt beg end use-regexp overlay-limit))))
(anzu--clear-overlays curbuf beg end)
- [nongnu] elpa/anzu dad14fa96c 244/288: Use h5 header for interfaces, (continued)
- [nongnu] elpa/anzu dad14fa96c 244/288: Use h5 header for interfaces, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 324c3e2db4 245/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 3328619fec 251/288: Update Changes and bump up version, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5cf1c7c16e 238/288: Merge pull request #72 from syohex/isearch-query-replace-api, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a1860f4c53 267/288: update url, copyright, and maintainer name, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 896b2be2eb 281/288: Wordsmith the documentation re *-thing functions (#111), ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 33e4f13429 287/288: migrate tests from circleci to github actions, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 13dadaed10 284/288: update circleci to new docker images, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 14e4483a5e 286/288: Add ability to use lax whitespace (#119), ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 420f0c6894 137/288: Merge pull request #29 from bbatsov/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu cb70e6c611 145/288: Fix wrong counting total matched number when used default input,
ELPA Syncer <=
- [nongnu] elpa/anzu b600df38cb 144/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ec0d1f5485 147/288: Merge pull request #33 from syohex/fix-replace-command-bugs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ab561fe896 151/288: Use symbol-value instead of eval-when-compile + defvar, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 439e904931 155/288: Enable case-sensitive replacement for at cursor commands, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 686b264468 158/288: Refactoring: better getting migemo variable, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e664721a7f 157/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 137fc52ca2 159/288: Merge pull request #37 from syohex/improve-for-migemo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e782725f80 162/288: Support case sensitive highlighting, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu cf3370967b 170/288: Refactoring for evil-anzu, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 53db7f64b7 177/288: Reduce condition check, ELPA Syncer, 2022/01/06