[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu 43cb178b16 133/288: Update mode line like searching i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu 43cb178b16 133/288: Update mode line like searching in replacing command |
Date: |
Thu, 6 Jan 2022 03:58:46 -0500 (EST) |
branch: elpa/anzu
commit 43cb178b16486f9a531f810a7fc7fda4590731e7
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Update mode line like searching in replacing command
---
anzu.el | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/anzu.el b/anzu.el
index a4a2e1fb9c..e41169e1fc 100644
--- a/anzu.el
+++ b/anzu.el
@@ -228,6 +228,7 @@
(defsubst anzu--reset-status ()
(setq anzu--total-matched 0
anzu--current-posion 0
+ anzu--state nil
anzu--last-command nil
anzu--last-isearch-string nil
anzu--overflow-p nil))
@@ -243,14 +244,14 @@
here))
(defun anzu--update-mode-line-default (here total)
- (cl-case anzu--state
- (search (propertize (format "(%s/%d%s)"
- (anzu--format-here-position here total)
- total (if anzu--overflow-p "+" ""))
- 'face 'anzu-mode-line))
- (replace (propertize (format "(%d replace)" total)
- 'face 'anzu-mode-line))
- (otherwise "")))
+ (when anzu--state
+ (let ((status (cl-case anzu--state
+ (search (format "(%s/%d%s)"
+ (anzu--format-here-position here total)
+ total (if anzu--overflow-p "+" "")))
+ (replace-query (format "(%d replace)" total))
+ (replace (format "(%d/%d)" here total)))))
+ (propertize status 'face 'anzu-mode-line))))
(defun anzu--update-mode-line ()
(let ((update-func (or anzu-mode-line-update-function
@@ -533,8 +534,13 @@
(list from to delimited beg end backward)
(list from to delimited beg end)))
+(defadvice replace-match-maybe-edit (before anzu-replace-match activate)
+ (when (eq anzu--state 'replace)
+ (force-mode-line-update)
+ (cl-incf anzu--current-posion)))
+
(cl-defun anzu--query-replace-common (use-regexp &key at-cursor thing
prefix-arg (query t))
- (anzu--cons-mode-line 'replace)
+ (anzu--cons-mode-line 'replace-query)
(let* ((use-region (use-region-p))
(backward (anzu--replace-backward-p prefix-arg))
(overlay-limit (anzu--overlay-limit))
@@ -557,7 +563,8 @@
(anzu--query-replace-read-to
from prompt beg end use-regexp overlay-limit))))
(anzu--clear-overlays curbuf beg end)
- (setq clear-overlay t)
+ (setq anzu--state 'replace anzu--current-posion 1
+ clear-overlay t)
(if use-regexp
(apply 'perform-replace
(anzu--construct-perform-replace-arguments
from to delimited beg end backward
query))
- [nongnu] elpa/anzu 5c59c252d5 099/288: Fix ignore case problem, (continued)
- [nongnu] elpa/anzu 5c59c252d5 099/288: Fix ignore case problem, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu bac9660b47 102/288: Add non query replace command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a81c99b146 105/288: Merge pull request #18 from syohex/switch-to-cl-lib, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e26f29af37 109/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a06fb937b5 110/288: Enable lexical-binding, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e817db8532 115/288: Fix byte compile warning for Emacs 24.3, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu f3c83f3109 116/288: Merge pull request #21 from syohex/fix-byte-compile-warning, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b7185acafc 122/288: Use original function name instead of alias, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a77aa41dbc 121/288: Update Git animation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 59fec57b13 124/288: Add Cask file for testing, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 43cb178b16 133/288: Update mode line like searching in replacing command,
ELPA Syncer <=
- [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