Function: consult--point-placement

consult--point-placement is a byte-compiled function defined in consult.el.

Signature

(consult--point-placement STR START &rest IGNORED-FACES)

Documentation

Compute point placement from STR with START offset.

IGNORED-FACES are ignored when searching for matches. Return cons of point position and a list of match begin/end pairs.

Source Code

;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
(defun consult--point-placement (str start &rest ignored-faces)
  "Compute point placement from STR with START offset.
IGNORED-FACES are ignored when searching for matches.
Return cons of point position and a list of match begin/end pairs."
  (let* ((matches (apply #'consult--find-highlights str start ignored-faces))
         (pos (pcase-exhaustive consult-point-placement
                ('match-beginning (or (caar matches) 0))
                ('match-end (or (cdar (last matches)) 0))
                ('line-beginning 0))))
    (dolist (match matches)
      (decf (car match) pos)
      (decf (cdr match) pos))
    (cons pos matches)))