Function: consult--display-width
consult--display-width is a natively compiled function defined in
consult.el.
Signature
(consult--display-width STRING)
Documentation
Compute width of STRING taking display and invisible properties into account.
Source Code
;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
(defun consult--display-width (string)
"Compute width of STRING taking display and invisible properties into account."
(let ((pos 0) (width 0) (end (length string)))
(while (< pos end)
(let ((nextd (next-single-property-change pos 'display string end))
(display (get-text-property pos 'display string)))
(if (stringp display)
(setq width (+ width (string-width display))
pos nextd)
(while (< pos nextd)
(let ((nexti (next-single-property-change pos 'invisible string nextd)))
(unless (get-text-property pos 'invisible string)
(setq width (+ width (string-width string pos nexti))))
(setq pos nexti))))))
width))