[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vertico 11fcf91 2/5: vertico-quick: Check that first ke
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vertico 11fcf91 2/5: vertico-quick: Check that first key matches |
Date: |
Sat, 10 Jul 2021 16:57:16 -0400 (EDT) |
branch: externals/vertico
commit 11fcf91a3aaaf6eb24a24ef3b443986addff468a
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@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))))