]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy-completion-in-region): Use compact ivy-count-format
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 5 Jan 2016 15:05:47 +0000 (16:05 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 5 Jan 2016 15:05:47 +0000 (16:05 +0100)
ivy.el

diff --git a/ivy.el b/ivy.el
index feff8d9606b1aff873ddf28b8bc62948e1e839f2..8ab813904351bc153a2793214becbb7139ec172a 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1380,7 +1380,9 @@ The previous string is between `ivy-completion-beg' and `ivy-completion-end'."
 (defun ivy-completion-in-region (start end collection &optional predicate)
   "An Ivy function suitable for `completion-in-region-function'."
   (let* ((str (buffer-substring-no-properties start end))
-         (comps (all-completions str collection predicate)))
+         (comps (all-completions str collection predicate))
+         (w (1+ (floor (log (length comps) 10))))
+         (ivy-count-format (format "%%-%dd " w)))
     (if (null comps)
         (message "No matches")
       (setq ivy-completion-beg start)