]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy-flx-limit): Configure when flx is used
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 15 Jan 2016 16:00:34 +0000 (17:00 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 15 Jan 2016 16:00:34 +0000 (17:00 +0100)
Re #207

ivy.el

diff --git a/ivy.el b/ivy.el
index f48459f32ed49b7b0754d5311fd8ea96532c3e47..d43f60f8542e74f3d3dee085183c6d740a1ea92b 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -2033,11 +2033,16 @@ Prefix matches to NAME are put ahead of the list."
     ivy-minibuffer-match-face-4)
   "List of `ivy' faces for minibuffer group matches.")
 
+(defvar ivy-flx-limit 200
+  "Used to conditionally turn off flx sorting.
+When the amount of matching candidates is larger than this
+number, no sorting will be done.")
+
 (defun ivy--flx-sort (name cands)
   "Sort according to closeness to string NAME the string list CANDS."
   (condition-case nil
       (if (and cands
-               (< (length cands) 200))
+               (< (length cands) ivy-flx-limit))
           (let* ((flx-name (if (string-match "^\\^" name)
                                (substring name 1)
                              name))