[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu 10bc7c5fbd 171/288: Merge pull request #41 from syohe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu 10bc7c5fbd 171/288: Merge pull request #41 from syohex/refactoring |
Date: |
Thu, 6 Jan 2022 03:58:50 -0500 (EST) |
branch: elpa/anzu
commit 10bc7c5fbdb94058e172d1659dfda9780485eff1
Merge: 9064fc7892 cf3370967b
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Merge pull request #41 from syohex/refactoring
Refactoring for evil-anzu
---
anzu.el | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/anzu.el b/anzu.el
index 88e90175ae..dc0d64384c 100644
--- a/anzu.el
+++ b/anzu.el
@@ -203,19 +203,22 @@
(eq isearch-regexp (cdr anzu--last-search-state))
(string= input anzu--last-isearch-string)))
-(defun anzu--update ()
- (when (>= (length isearch-string) anzu-minimum-input-length)
- (let ((result (if (anzu--use-result-cache-p isearch-string)
+(defun anzu--update (query)
+ (when (>= (length query) anzu-minimum-input-length)
+ (let ((result (if (anzu--use-result-cache-p query)
anzu--cached-positions
- (anzu--search-all-position isearch-string))))
+ (anzu--search-all-position query))))
(let ((curpos (anzu--where-is-here (plist-get result :positions)
(point))))
(setq anzu--total-matched (plist-get result :count)
anzu--overflow-p (plist-get result :overflow)
anzu--current-position curpos
anzu--last-search-state (cons isearch-word isearch-regexp)
- anzu--last-isearch-string isearch-string)
+ anzu--last-isearch-string query)
(force-mode-line-update)))))
+(defun anzu--update-post-hook ()
+ (anzu--update isearch-string))
+
(defconst anzu--mode-line-format '(:eval (anzu--update-mode-line)))
(defsubst anzu--mode-line-not-set-p ()
@@ -272,10 +275,10 @@
:lighter anzu-mode-lighter
(if anzu-mode
(progn
- (add-hook 'isearch-update-post-hook 'anzu--update nil t)
+ (add-hook 'isearch-update-post-hook 'anzu--update-post-hook nil t)
(add-hook 'isearch-mode-hook 'anzu--cons-mode-line-search nil t)
(add-hook 'isearch-mode-end-hook 'anzu--reset-mode-line nil t))
- (remove-hook 'isearch-update-post-hook 'anzu--update t)
+ (remove-hook 'isearch-update-post-hook 'anzu--update-post-hook t)
(remove-hook 'isearch-mode-hook 'anzu--cons-mode-line t)
(remove-hook 'isearch-mode-end-hook 'anzu--reset-mode-line t)
(anzu--reset-mode-line)))
- [nongnu] elpa/anzu 67b98d6103 146/288: Improve calculation of current replacement position, (continued)
- [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, 2022/01/06
- [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 <=
- [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
- [nongnu] elpa/anzu 722ed9a52c 256/288: Merge pull request #84 from syohex/update-minimum-emacs-version, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 61cb32aa61 278/288: reapply #93 by hand, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 1da06b0717 262/288: Don't use cl-loop for Emacs 27 bug, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5ac649fc77 264/288: Fix wrong count issue with case-sensitive search, ELPA Syncer, 2022/01/06