- Add tp--merge-string-props-into-plist to merge embedded properties
from tp-text value into props plist with proper face merging
- Simplify tp--handle-tp-text-property to use the new merge function
and return merged props directly
- Simplify tp-set, tp-reset, tp-add by removing marker-based handling
- Fix tp-add to avoid duplicate face merging for strings with tp-text
- Remove unused tp--apply-string-props-to-region and
tp--remove-internal-markers functions
- Update tests to match the simplified implementation
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
Use tp--string-has-properties-p helper function instead of checking
only position 0. This properly detects text properties that start at
non-zero positions in the string.
Added test tp-test-tp-text-with-properties-starting-at-nonzero to
verify this fix.
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
- Modify tp--handle-tp-text-property to detect and preserve embedded text
properties in tp-text values for both strings and buffers
- Add tp--apply-string-props-to-region helper to apply string properties
- Update tp-set, tp-reset, tp-add to preserve embedded tp-text properties
by using put-text-property instead of set-text-properties when needed
- Update tp--replace-reactive-text-in-buffer to preserve embedded properties
- Add tests for tp-text with embedded text properties
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
The bug occurred because tp--parse-args was incorrectly omitting nil values
from the property list, producing (face) instead of (face nil).
Fixed the same bug pattern in:
- tp--parse-args (used by tp-set, tp-reset, tp-add)
- tp-add-to-layers
- tp-add-to-all-layers
Added 6 new regression tests for nil property values.
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
When a define-tp layer returns a plist containing other custom layer names,
those are now recursively expanded to their built-in text properties.
This fixes the issue where tp-button using tp-palette internally would
leave tp-palette as a text property instead of resolving it to the
actual face properties.
Changes:
- Added tp--plist-has-layer-key-p helper function
- Updated tp--expand-layer-in-plist to recursively expand layer props
- Updated tp-layer-props to expand nested layers in returned plist
- Updated tp-layer-props-with-arg to expand nested layers in returned plist
- Added 3 tests for nested layer resolution
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>