Function: corfu--prepare

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

Signature

(corfu--prepare)

Documentation

Insert selected candidate unless command is marked to continue completion.

Implementations

:before (corfu--prepare (NIL ((&context . corfu-echo-mode) eql t))) in `corfu-echo.el'.

Undocumented

:before (corfu--prepare (NIL ((&context . corfu-indexed-mode) eql t))) in `corfu-indexed.el'.

Undocumented

(corfu--prepare) in `corfu.el'.

Undocumented

Source Code

;; Defined in ~/.emacs.d/elpa/corfu-20260813.950/corfu.el
(cl-defgeneric corfu--prepare ()
  "Insert selected candidate unless command is marked to continue completion."
  (corfu--preview-delete)
  ;; Ensure that state is initialized before next Corfu command
  (when (and (symbolp this-command) (string-prefix-p "corfu-" (symbol-name this-command)))
    (corfu--update))
  ;; If the next command is not listed in `corfu-continue-commands', insert the
  ;; currently selected candidate and bail out of completion. This way you can
  ;; continue typing after selecting a candidate. The candidate will be inserted
  ;; and your new input will be appended.
  (and (corfu--preview-current-p) (eq corfu-preview-current 'insert)
       ;; See the comment about `overriding-local-map' in `corfu--post-command'.
       (not (or overriding-terminal-local-map
                (corfu--match-symbol-p corfu-continue-commands this-command)))
       (corfu--insert 'exact)))