Function: consult--find-highlights
consult--find-highlights is a natively compiled function defined in
consult.el.
Signature
(consult--find-highlights STR START &rest IGNORED-FACES)
Documentation
Find highlighted regions in STR from position START.
Highlighted regions have a non-nil face property. IGNORED-FACES are ignored when searching for matches.
Source Code
;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
;;;; Regexp utilities
(defun consult--find-highlights (str start &rest ignored-faces)
"Find highlighted regions in STR from position START.
Highlighted regions have a non-nil face property.
IGNORED-FACES are ignored when searching for matches."
(let (highlights
(end (length str))
(beg start))
(while (< beg end)
(let ((next (next-single-property-change beg 'face str end))
(val (get-text-property beg 'face str)))
(when (and val
(not (memq val ignored-faces))
(not (and (consp val)
(any (lambda (x) (memq x ignored-faces)) val))))
(push (cons (- beg start) (- next start)) highlights))
(setq beg next)))
(nreverse highlights)))