Fix duplicate foreground property in face when updating tp-text
Changed from using tp-add to set-text-properties when text content is same but properties differ. This prevents duplicate property merging since merged-props already contains the complete set of properties. Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
This commit is contained in:
parent
467a4c16f4
commit
45268b6e5a
4
tp.el
4
tp.el
@ -1012,8 +1012,8 @@ Text properties embedded in NEW-TEXT are merged with PROPS."
|
||||
(old-text (buffer-substring-no-properties m-start m-end)))
|
||||
(if (equal old-text (substring-no-properties new-text))
|
||||
;; Text content is the same, but properties may differ
|
||||
;; Use tp-add to update properties (merges embedded props from new-text)
|
||||
(tp-add m-start m-end merged-props)
|
||||
;; Use set-text-properties to replace with merged properties
|
||||
(set-text-properties m-start m-end merged-props)
|
||||
;; Text content is different - delete old text and insert new
|
||||
(delete-region m-start m-end)
|
||||
(goto-char m-start)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user