]> code.delx.au - gnu-emacs-elpa/commitdiff
Allow ivy-count-format to be set as nil
authorChunyang Xu <xuchunyang56@gmail.com>
Sat, 1 Aug 2015 05:42:46 +0000 (13:42 +0800)
committerChunyang Xu <xuchunyang56@gmail.com>
Sat, 1 Aug 2015 05:42:46 +0000 (13:42 +0800)
ivy.el

diff --git a/ivy.el b/ivy.el
index 55005de6bb842ff70394419f0e2e9aa86a7e1bef..faa469bd97ccecc190111d55b8476058014d226f 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -72,7 +72,7 @@
 Set this to nil if you don't want the count.  You can also set it
 to e.g. \"(%d/%d) \" if you want to see both the candidate index
 and the candidate count."
-  :type 'string)
+  :type '(choice (const :tag "Count disabled" nil) string))
 
 (defcustom ivy-wrap nil
   "Whether to wrap around after the first and last candidate."
@@ -993,6 +993,8 @@ This is useful for recursive `ivy-read'."
     (setq ivy--prompt
           (cond ((string-match "%.*d" prompt)
                  prompt)
+                ((null ivy-count-format)
+                 nil)
                 ((string-match "%d.*%d" ivy-count-format)
                  (let ((w (length (number-to-string
                                    (length ivy--all-candidates))))