emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-anzu 995141132b 17/27: Merge pull request #6 from Gor


From: ELPA Syncer
Subject: [nongnu] elpa/evil-anzu 995141132b 17/27: Merge pull request #6 from GordonGustafson/master
Date: Thu, 6 Jan 2022 03:59:31 -0500 (EST)

branch: elpa/evil-anzu
commit 995141132bbf063fe568a6562bcf8bb8a827c784
Merge: faccb0e8c6 6cac9c1fef
Author: Fredrik Bergroth <fbergroth@gmail.com>
Commit: Fredrik Bergroth <fbergroth@gmail.com>

    Merge pull request #6 from GordonGustafson/master
    
    Make anzu work with the 'evil-search search module
---
 evil-anzu.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/evil-anzu.el b/evil-anzu.el
index 0978f62e3d..c9e0fa20e3 100644
--- a/evil-anzu.el
+++ b/evil-anzu.el
@@ -33,11 +33,25 @@
   (let ((isearch-regexp regexp-p))
     (anzu--update string)))
 
+(defadvice evil-ex-find-next (after evil-anzu-compat (&optional pattern 
direction nowrap) activate)
+  "Make anzu work with the 'evil-search search module.
+If PATTERN is not specified the current global pattern 
`evil-ex-search-pattern' is used."
+  (anzu--cons-mode-line-search)
+  (let* ((isearch-regexp t)      ; all evil-ex searches are regexp searches
+         (current-pattern (or pattern evil-ex-search-pattern))
+         (regexp (evil-ex-pattern-regex current-pattern)))
+    (save-match-data            ; don't let anzu's searching mess up evil
+      (anzu--update regexp))))
+
 (defadvice evil-flash-hook (after evil-anzu-compat activate)
   ;; Prevent flickering, only run if timer is not active
   (unless (memq evil-flash-timer timer-list)
     (anzu--reset-mode-line)))
 
+(defadvice evil-ex-delete-hl (after evil-anzu-compat (name) activate)
+  (when (eq name 'evil-ex-search)
+    (anzu--reset-mode-line)))
+
 (provide 'evil-anzu)
 
 ;;; evil-anzu.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]