[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 16486d5 394/399: ivy.el (ivy--shorter-matches-first): Add
From: |
Oleh Krehel |
Subject: |
[elpa] master 16486d5 394/399: ivy.el (ivy--shorter-matches-first): Add and use for ivy-completion-in-region |
Date: |
Sat, 20 Jul 2019 14:58:06 -0400 (EDT) |
branch: master
commit 16486d5b78222b0a78c8a71699b257f51c03d6cc
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy--shorter-matches-first): Add and use for
ivy-completion-in-region
---
ivy.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/ivy.el b/ivy.el
index 1c2da08..d224484 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3240,8 +3240,18 @@ CANDIDATES are assumed to be static."
res))))
(setq ivy--all-candidates res)))
+(defun ivy--shorter-matches-first (_name cands)
+ "Sort CANDS according to their length."
+ (if (< (length cands) ivy-sort-max-size)
+ (cl-sort
+ (copy-sequence cands)
+ (lambda (s1 s2)
+ (< (length s1) (length s2))))
+ cands))
+
(defcustom ivy-sort-matches-functions-alist
'((t . nil)
+ (ivy-completion-in-region . ivy--shorter-matches-first)
(ivy-switch-buffer . ivy-sort-function-buffer))
"An alist of functions for sorting matching candidates.
- [elpa] master c4c6068 384/399: doc/ivy.org: Fix RET -> C-j, (continued)
- [elpa] master c4c6068 384/399: doc/ivy.org: Fix RET -> C-j, Oleh Krehel, 2019/07/20
- [elpa] master ee5dacf 385/399: Add swiper-backward command, Oleh Krehel, 2019/07/20
- [elpa] master 3c6790f 387/399: ivy.el (ivy-immediate-done): Improve make-directory, Oleh Krehel, 2019/07/20
- [elpa] master 6e50ab6 391/399: ivy-test.el (swiper-isearch-backward): Goto old match on DEL, Oleh Krehel, 2019/07/20
- [elpa] master 714911b 389/399: ivy.el (ivy--sort): Higher priority for ivy-sort-matches-functions-alist, Oleh Krehel, 2019/07/20
- [elpa] master 56a1f7d 386/399: Add counsel-grep-backward and counsel-grep-or-swiper-backward commands, Oleh Krehel, 2019/07/20
- [elpa] master 79de883 388/399: ivy.el (ivy--sort): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master f5508e5 390/399: swiper.el (swiper-isearch-backward): Add backward search, Oleh Krehel, 2019/07/20
- [elpa] master af0799a 393/399: counsel.el (counsel-git-log-show-commit-action): Fix match end., Oleh Krehel, 2019/07/20
- [elpa] master 54d1b19 392/399: swiper.el (swiper-isearch-action): Use swiper-action-recenter, Oleh Krehel, 2019/07/20
- [elpa] master 16486d5 394/399: ivy.el (ivy--shorter-matches-first): Add and use for ivy-completion-in-region,
Oleh Krehel <=
- [elpa] master f99f13a 396/399: Increase swiper-isearch cursor overlay priority, Oleh Krehel, 2019/07/20
- [elpa] master b5db0aa 397/399: ivy.el (ivy--insert-prompt): Adjust ivy-use-selectable-prompt, Oleh Krehel, 2019/07/20
- [elpa] master 74095a2 395/399: ivy-test.el (swiper-isearch-backward): Test match at point, Oleh Krehel, 2019/07/20
- [elpa] master 85d1e2e 398/399: doc/Changelog.org: Release 0.12.0, Oleh Krehel, 2019/07/20
- [elpa] master 33689c1 399/399: Merge commit '85d1e2e779ca92e6ef8e47d08f866b13d4d87aee' from ivy, Oleh Krehel, 2019/07/20