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

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

[elpa] master a0f1e25 021/272: ivy.el (ivy-completion-in-region): Fix lo


From: Oleh Krehel
Subject: [elpa] master a0f1e25 021/272: ivy.el (ivy-completion-in-region): Fix log 0 issue
Date: Mon, 25 Apr 2016 10:13:14 +0000

branch: master
commit a0f1e25c632a219a8054932cdde860fc61c4e57b
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy-completion-in-region): Fix log 0 issue
---
 ivy.el |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/ivy.el b/ivy.el
index b83c7b4..c70fa65 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1382,19 +1382,19 @@ 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))
-         (w (1+ (floor (log (length comps) 10))))
-         (ivy-count-format (format "%%-%dd " w)))
+         (comps (all-completions str collection predicate)))
     (if (null comps)
         (message "No matches")
-      (setq ivy-completion-beg start)
-      (setq ivy-completion-end end)
-      (and
-       (ivy-read (format "(%s): " str) comps
-                 :predicate predicate
-                 :action #'ivy-completion-in-region-action
-                 :require-match t)
-       t))))
+      (let* ((w (1+ (floor (log (length comps) 10))))
+             (ivy-count-format (format "%%-%dd " w)))
+        (setq ivy-completion-beg start)
+        (setq ivy-completion-end end)
+        (and
+         (ivy-read (format "(%s): " str) comps
+                   :predicate predicate
+                   :action #'ivy-completion-in-region-action
+                   :require-match t)
+         t)))))
 
 ;;;###autoload
 (define-minor-mode ivy-mode



reply via email to

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