Function: marginalia--full-candidate

marginalia--full-candidate is a natively compiled function defined in marginalia.el.

Signature

(marginalia--full-candidate CAND)

Documentation

Return completion candidate CAND in full.

For some completion tables, the completion candidates offered are meant to be only a part of the full minibuffer contents. For example, during file name completion the candidates are one path component of a full file path.

Source Code

;; Defined in /nix/store/hym71by08nv7fpgl7asan3dvidx05yya-emacs-packages-deps/share/emacs/site-lisp/elpa/marginalia-20260926.1228/marginalia.el
(defun marginalia--full-candidate (cand)
  "Return completion candidate CAND in full.
For some completion tables, the completion candidates offered are
meant to be only a part of the full minibuffer contents.  For
example, during file name completion the candidates are one path
component of a full file path."
  (if-let* ((win (active-minibuffer-window)))
      (with-current-buffer (window-buffer win)
        (concat (let ((end (minibuffer-prompt-end)))
                  (buffer-substring-no-properties
                   end (+ end marginalia--base-position)))
                cand))
    ;; no minibuffer is active, trust that cand already conveys all
    ;; necessary information (there's not much else we can do)
    cand))