branch: externals/vertico commit 11fcf91a3aaaf6eb24a24ef3b443986addff468a Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
vertico-quick: Check that first key matches --- extensions/vertico-quick.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/vertico-quick.el b/extensions/vertico-quick.el index 80f8e13..72a5c07 100644 --- a/extensions/vertico-quick.el +++ b/extensions/vertico-quick.el @@ -73,7 +73,8 @@ (if (>= idx fst) (let ((first (elt vertico-quick2 (mod (/ (- idx fst) len) snd))) (second (elt (concat vertico-quick1 vertico-quick2) (mod (- idx fst) len)))) - (push (cons (+ (lsh first 16) second) index) vertico-quick--list) + (push (cons first t) vertico-quick--list) + (push (cons (+ first (lsh second 16)) index) vertico-quick--list) (cond ((eq first vertico-quick--first) (concat sp (propertize (char-to-string second) 'face 'vertico-quick1))) @@ -100,11 +101,12 @@ (symbol-function #'vertico--format-candidate)))) (vertico--exhibit) (setq key (read-key)) - (when (seq-position vertico-quick2 key) + (when (and (alist-get key vertico-quick--list) + (seq-position vertico-quick2 key)) (let ((vertico-quick--first key) (vertico-quick--list)) (vertico--exhibit)) - (setq key (+ (lsh key 16) (read-key)))) + (setq key (+ key (lsh (read-key) 16)))) (when-let (idx (alist-get key vertico-quick--list)) (setq vertico--index idx))))