[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu caf83591e4 134/288: Merge pull request #28 from syohe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu caf83591e4 134/288: Merge pull request #28 from syohex/improve-replace-mode-line |
Date: |
Thu, 6 Jan 2022 03:58:46 -0500 (EST) |
branch: elpa/anzu
commit caf83591e486167b56926fa2f6620f817dd7a175
Merge: 1ae7297bc7 43cb178b16
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Merge pull request #28 from syohex/improve-replace-mode-line
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 5e6bad85d4 036/288: bump up version and update Changes, (continued)
- [nongnu] elpa/anzu 5e6bad85d4 036/288: bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 169cf55674 044/288: Use previous result if regexp validation is failed, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu d256c967f3 052/288: Fix message in mode-line at replace command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 413bd09ebc 079/288: Fix different behavior from query-replace-regexp, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b310647932 085/288: Add separator parameter of 'to' string, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 047c5eee99 083/288: add anzu replace command screencast, ELPA Syncer, 2022/01/06
- [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 <=
- [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, 2022/01/06
- [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