Skip to content

Commit ec94213

Browse files
committed
Fix (confirm) and (match required) face properties
This continues from the previous commit of 2025-11-22 "Don't completely replace prompt text properties". * ivy.el (ivy-set-prompt-text-properties-default): Retain existing faces by using add-face-text-property (#3077).
1 parent 4b1df7c commit ec94213

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ivy.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,11 +3170,11 @@ parts beyond their respective faces `ivy-confirm-face' and
31703170
`ivy-match-required-face'."
31713171
(dolist (pair '(("confirm" . ivy-confirm-face)
31723172
("match required" . ivy-match-required-face)))
3173-
(let ((i (string-match-p (car pair) prompt)))
3174-
(when i
3175-
(add-text-properties i (+ i (length (car pair)))
3176-
`(face ,(cdr pair) ,@props)
3177-
prompt))))
3173+
(let* ((beg (ivy--string-search (car pair) prompt))
3174+
(end (and beg (+ beg (length (car pair))))))
3175+
(when beg
3176+
(add-face-text-property beg end (cdr pair) nil prompt)
3177+
(add-text-properties beg end props prompt))))
31783178
prompt)
31793179

31803180
(defun ivy-prompt ()

0 commit comments

Comments
 (0)