branch: master
commit 0d410d30cb699328c44a59f5d71171bf758bbe84
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-flx-limit): Configure when flx is used
Re #207
---
ivy.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ivy.el b/ivy.el
index f48459f..d43f60f 100644
--- 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))