summaryrefslogtreecommitdiff
path: root/corfu.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2022-11-10 18:38:59 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2022-11-10 18:38:59 +0100
commit6f187a8adb165da5657288b83e429dee1dbb0591 (patch)
tree424857c643270c6307add8b7bbe4115e1e89739e /corfu.el
parente6e8fa6684396e6efe1c29c4413657f0bb76ce03 (diff)
Rename sort predicate, corresponding to Vertico
Diffstat (limited to 'corfu.el')
-rw-r--r--corfu.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/corfu.el b/corfu.el
index 818cc8d..651e6f5 100644
--- a/corfu.el
+++ b/corfu.el
@@ -566,13 +566,13 @@ A scroll bar is displayed from LO to LO+BAR."
(cons (apply #'completion-all-completions args) hl))
(cons (apply #'completion-all-completions args) hl))))
-(defun corfu--sort-predicate (x y)
- "Sorting predicate which compares X and Y."
+(defsubst corfu--length-string< (x y)
+ "Sorting predicate which compares X and Y first by length then by `string<'."
(or (< (length x) (length y)) (and (= (length x) (length y)) (string< x y))))
(defun corfu-sort-length-alpha (list)
"Sort LIST by length and alphabetically."
- (sort list #'corfu--sort-predicate))
+ (sort list #'corfu--length-string<))
(defmacro corfu--partition! (list form)
"Evaluate FORM for every element and partition LIST."