Function: avy--overlay-at
avy--overlay-at is a byte-compiled function defined in avy.el.
Signature
(avy--overlay-at PATH LEAF)
Documentation
Create an overlay with PATH at LEAF.
PATH is a list of keys from tree root to LEAF. LEAF is normally ((BEG . END) . WND).
Source Code
;; Defined in ~/.emacs.d/elpa/avy-20241101.1357/avy.el
(defun avy--overlay-at (path leaf)
"Create an overlay with PATH at LEAF.
PATH is a list of keys from tree root to LEAF.
LEAF is normally ((BEG . END) . WND)."
(let* ((path (mapcar #'avy--key-to-char path))
(str (propertize
(string (car (last path)))
'face 'avy-lead-face)))
(avy--overlay
str
(avy-candidate-beg leaf) nil
(avy-candidate-wnd leaf)
(lambda (str old-str)
(cond ((string= old-str "\n")
(concat str "\n"))
;; add padding for wide-width character
((eq (string-width old-str) 2)
(concat str " "))
(t
str))))))