Function: vertico-quick--keys

vertico-quick--keys is a byte-compiled function defined in vertico-quick.el.

Signature

(vertico-quick--keys TWO INDEX START)

Documentation

Format quick keys prefix.

INDEX is the current candidate index. START is the index of the first displayed candidate. TWO is non-nil if two keys should be displayed.

Source Code

;; Defined in ~/.emacs.d/elpa/vertico-20260821.1200/vertico-quick.el
(defun vertico-quick--keys (two index start)
  "Format quick keys prefix.
INDEX is the current candidate index.
START is the index of the first displayed candidate.
TWO is non-nil if two keys should be displayed."
  (let ((fst (length vertico-quick1))
        (snd (length vertico-quick2))
        (idx (- index start)))
    (if (>= idx fst)
        (let ((first (elt vertico-quick2 (mod (/ (- idx fst) fst) snd)))
              (second (elt vertico-quick1 (mod (- idx fst) fst))))
          (cond
           ((eq first two)
            (list
             (concat " " (propertize (char-to-string second) 'face 'vertico-quick1))
             (cons second index)))
           (two
            (list "  "))
           (t
            (list
             (concat (propertize (char-to-string first) 'face 'vertico-quick1)
                     (propertize (char-to-string second) 'face 'vertico-quick2))
             (cons first (list first))))))
      (let ((first (elt vertico-quick1 (mod idx fst))))
        (if two
            (list "  ")
          (list
           (concat (propertize (char-to-string first) 'face 'vertico-quick1) " ")
           (cons first index)))))))