Function: vertico--candidate

vertico--candidate is a byte-compiled function defined in vertico.el.

Signature

(vertico--candidate &optional HL)

Documentation

Return current candidate string with optional highlighting if HL is non-nil.

Source Code

;; Defined in ~/.emacs.d/elpa/vertico-20260811.1003/vertico.el
(defun vertico--candidate (&optional hl)
  "Return current candidate string with optional highlighting if HL is non-nil."
  (let ((content (or (car-safe vertico--input) (minibuffer-contents-no-properties))))
    (cond
     ((>= vertico--index 0)
      (let ((cand (substring (nth vertico--index vertico--candidates))))
        ;; XXX Drop the completions-common-part face which is added by the
        ;; `completion--twq-all' hack.  This should better be fixed in Emacs
        ;; itself, the corresponding code is already marked as fixme.
        (vertico--remove-face 0 (length cand) 'completions-common-part cand)
        (concat vertico--base (if hl (vertico--hilit cand) cand))))
     ((and (equal content "") (or (car-safe minibuffer-default) minibuffer-default)))
     (t content))))