branch: externals/ivy
commit ec9421340c88ebe08f05680e22308ed57ed68a3d
Author: Basil L. Contovounesios <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>
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).
---
ivy.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ivy.el b/ivy.el
index 62e81b75c4..3c900c9542 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3170,11 +3170,11 @@ parts beyond their respective faces `ivy-confirm-face'
and
`ivy-match-required-face'."
(dolist (pair '(("confirm" . ivy-confirm-face)
("match required" . ivy-match-required-face)))
- (let ((i (string-match-p (car pair) prompt)))
- (when i
- (add-text-properties i (+ i (length (car pair)))
- `(face ,(cdr pair) ,@props)
- prompt))))
+ (let* ((beg (ivy--string-search (car pair) prompt))
+ (end (and beg (+ beg (length (car pair))))))
+ (when beg
+ (add-face-text-property beg end (cdr pair) nil prompt)
+ (add-text-properties beg end props prompt))))
prompt)
(defun ivy-prompt ()