[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 997136ace1 2/4: Add comment
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 997136ace1 2/4: Add comment |
Date: |
Mon, 29 Jan 2024 13:00:25 -0500 (EST) |
branch: elpa/helm
commit 997136ace1449eebcba4690686d2bfe1ad31052d
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Add comment
---
helm-core.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/helm-core.el b/helm-core.el
index ea49a88805..bb93a4b6e2 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -4623,6 +4623,11 @@ the candidates."
(scr1 (car data1))
(scr2 (car data2)))
(cond ((= scr1 scr2)
+ ;; Comparison by length should not be called here most
of
+ ;; the time because we use now flex scoring which does
+ ;; such test, however we still use helm fuzzy scoring
+ ;; with preserve-tie-order, so keep testing length here
+ ;; for it.
(unless preserve-tie-order
(< len1 len2)))
((> scr1 scr2)))))))))
@@ -4637,6 +4642,9 @@ The default function,
`helm-fuzzy-matching-default-sort-fn',
sorts ties by length, shortest first. This function may be more
useful when the order of the candidates is meaningful, e.g. with
`recentf-list'."
+ ;; Flex scoring is already taking in account length of strings so this
+ ;; function have no effect when flex scoring is in use, force the usage of
+ ;; helm fuzzy scoring to ensure no testing against length is done.
(let ((helm-fuzzy-default-score-fn #'helm-fuzzy-helm-style-score))
(helm-fuzzy-matching-default-sort-fn-1 candidates nil nil t)))