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

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

[elpa] externals/ivy-hydra 0f4cb44 051/395: ivy.el (ivy-add-prompt-count


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 0f4cb44 051/395: ivy.el (ivy-add-prompt-count): Account for :dynamic-collection returning 0
Date: Thu, 25 Feb 2021 08:31:29 -0500 (EST)

branch: externals/ivy-hydra
commit 0f4cb44c5723564220d6faa8b6977f5a2044fd77
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy-add-prompt-count): Account for :dynamic-collection returning 0
    
    Re emacs-lsp/lsp-ivy#5
---
 ivy.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ivy.el b/ivy.el
index 5626023..343ba77 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2365,7 +2365,10 @@ This is useful for recursive `ivy-read'."
          (error
           "`ivy-count-format' can't be nil.  Set it to \"\" instead"))
         ((string-match "%d.*\\(%d\\)" ivy-count-format)
-         (let* ((w (1+ (floor (log (max 1 (length ivy--all-candidates)) 10))))
+         (let* ((w
+                  (if (listp ivy--all-candidates)
+                      (1+ (floor (log (max 1 (length ivy--all-candidates)) 
10)))
+                      1))
                 (s (replace-match (format "%%-%dd" w) t t ivy-count-format 1)))
            (string-match "%d" s)
            (concat (replace-match (format "%%%dd" w) t t s)



reply via email to

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