branch: elpa/anzu
commit ed5e91b0c45be0bef8ef2b388c6f7b80a76102e9
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>

    Add face at no-match case
---
 anzu.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/anzu.el b/anzu.el
index a8ac706df3..9ab18f9092 100644
--- a/anzu.el
+++ b/anzu.el
@@ -100,6 +100,10 @@
   '((t (:foreground "magenta" :weight bold)))
   "face of anzu modeline")
 
+(defface anzu-mode-line-no-match
+  '((t (:inherit anzu-mode-line)))
+  "face of anzu modeline in no match case")
+
 (defface anzu-replace-highlight
   '((t :inherit query-replace))
   "highlight of replaced string")
@@ -284,8 +288,11 @@
                                     (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))))
+                    (replace (format "(%d/%d)" here total))))
+          (face (if (and (zerop total) (not (string= isearch-string "")))
+                    'anzu-mode-line-no-match
+                  'anzu-mode-line)))
+      (propertize status 'face face))))
 
 (defun anzu--update-mode-line ()
   (funcall anzu-mode-line-update-function anzu--current-position 
anzu--total-matched))

Reply via email to