Function: corfu--insert

corfu--insert is a byte-compiled function defined in corfu.el.

Signature

(corfu--insert STATUS)

Documentation

Insert current candidate, exit with STATUS if non-nil.

Implementations

:before (corfu--insert STATUS (NIL ((&context . corfu-history-mode) eql t))) in `corfu-history.el'.

Undocumented

(corfu--insert STATUS) in `corfu.el'.

Undocumented

Source Code

;; Defined in ~/.emacs.d/elpa/corfu-20260813.950/corfu.el
(cl-defgeneric corfu--insert (status)
  "Insert current candidate, exit with STATUS if non-nil."
  ;; XXX There is a small bug here, depending on interpretation.
  ;; When completing "~/emacs/master/li|/calc" where "|" is the
  ;; cursor, then the candidate only includes the prefix
  ;; "~/emacs/master/lisp/", but not the suffix "/calc". Default
  ;; completion has the same problem when selecting in the
  ;; *Completions* buffer. See bug#48356.
  (pcase-let* ((`(,beg ,end . ,_) completion-in-region--data)
               (str (concat corfu--base (nth corfu--index corfu--candidates))))
    (corfu--replace beg end str)
    (corfu--goto -1) ;; Reset selection, completion may continue.
    (when status (corfu--done str status nil))
    str))