Skip to content

Commit f345f7f

Browse files
committed
Preserve text properties of prompt
1 parent 2257a9d commit f345f7f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

ivy.el

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,9 +3263,14 @@ parts beyond their respective faces `ivy-confirm-face' and
32633263
(when ivy-add-newline-after-prompt
32643264
(setq n-str (concat n-str "\n")))
32653265
(setq n-str (ivy--break-lines n-str (window-width)))
3266-
(set-text-properties 0 (length n-str)
3267-
`(face minibuffer-prompt ,@std-props)
3268-
n-str)
3266+
(let ((old-props (when (fboundp 'object-intervals)
3267+
(object-intervals n-str))))
3268+
(set-text-properties 0 (length n-str)
3269+
`(face minibuffer-prompt ,@std-props)
3270+
n-str)
3271+
(dolist (propdata old-props)
3272+
(cl-destructuring-bind (beg end props) propdata
3273+
(add-text-properties beg end props n-str))))
32693274
(setq n-str (funcall ivy-set-prompt-text-properties-function
32703275
n-str std-props))
32713276
(insert n-str))

0 commit comments

Comments
 (0)