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

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

[nongnu] elpa/evil-anzu 6cac9c1fef 16/27: Make anzu work with the 'evil-


From: ELPA Syncer
Subject: [nongnu] elpa/evil-anzu 6cac9c1fef 16/27: Make anzu work with the 'evil-search search module
Date: Thu, 6 Jan 2022 03:59:31 -0500 (EST)

branch: elpa/evil-anzu
commit 6cac9c1fef336ad0f35ffea9223fc3a6c25f9d62
Author: Gordon Gustafson <gordon3.14@gmail.com>
Commit: Gordon Gustafson <gordon3.14@gmail.com>

    Make anzu work with the 'evil-search search module
    
    To test, run "make emacs" from evil's directory and switch to the
    'evil-search search module:
    
        (evil-select-search-module 'evil-search-module 'evil-search)
---
 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]