Function: corfu--move-prefix-candidates-to-front

corfu--move-prefix-candidates-to-front is a byte-compiled function defined in corfu.el.

Signature

(corfu--move-prefix-candidates-to-front FIELD CANDS)

Documentation

Move CANDS which match prefix of FIELD to the beginning.

Source Code

;; Defined in ~/.emacs.d/elpa/corfu-20260813.950/corfu.el
(defun corfu--move-prefix-candidates-to-front (field cands)
  "Move CANDS which match prefix of FIELD to the beginning."
  (let* ((word (substring field 0
                          (seq-position field corfu-separator)))
         (len (length word)))
    (corfu--partition!
     cands
     (and (>= (length it) len)
          (eq t (compare-strings word 0 len it 0 len
                                 completion-ignore-case))))))