branch: externals/vertico
commit 6d700d809cff0ad76e2e13f251a24f5cdea75ec7
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Use stricter definition of the affixation-function
See
https://github.com/emacs-mirror/emacs/commit/d8e037eeaa7eef26349bc0fb3fa00e10a5c4b894
---
vertico.el | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/vertico.el b/vertico.el
index f9d9129..c63a738 100644
--- a/vertico.el
+++ b/vertico.el
@@ -198,7 +198,7 @@
(funcall aff candidates)
(if-let (ann (or (completion-metadata-get metadata 'annotation-function)
(plist-get completion-extra-properties
:annotation-function)))
- (mapcar (lambda (cand) (list cand (or (funcall ann cand) "")))
candidates)
+ (mapcar (lambda (cand) (list cand "" (or (funcall ann cand) "")))
candidates)
candidates)))
(defun vertico--move-to-front (elem list)
@@ -344,12 +344,10 @@
(vertico--annotate metadata)))
(max-width (- (window-width) 4))
(current-line 0) (title) (lines))
- (dolist (ann-cand candidates)
- (let* ((prefix "") (suffix "")
- (cand (pcase ann-cand
- (`(,c ,s) (setq suffix s) c)
- (`(,c ,p ,s) (setq prefix p suffix s) c)
- (c c))))
+ (dolist (cand candidates)
+ (let ((prefix "") (suffix ""))
+ (when (consp cand)
+ (setq prefix (cadr cand) suffix (caddr cand) cand (car cand)))
(when-let (new-title (and group-format (funcall title-fun cand nil)))
(unless (equal title new-title)
(push (format group-format (setq title new-title)) lines))