Skip to content
Prev Previous commit
Next Next commit
fix merge-attribute: also included plist
  • Loading branch information
cxxxr committed Jul 30, 2023
commit 19e88f91948a9f7363a6e666734b22b186bbe096
10 changes: 7 additions & 3 deletions src/attribute.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
:initform nil
:accessor attribute-cache)
(plist
:initarg :plist
:initform nil
:accessor attribute-plist)))

Expand All @@ -43,13 +44,14 @@
(defun (setf attribute-value) (value attribute key)
(setf (getf (attribute-plist attribute) key) value))

(defun make-attribute (&key foreground background reverse bold underline)
(defun make-attribute (&key foreground background reverse bold underline plist)
(make-instance 'attribute
:foreground (or (maybe-base-color foreground) nil)
:background (or (maybe-base-color background) nil)
:reverse reverse
:bold bold
:underline (or (maybe-base-color underline) underline)))
:underline (or (maybe-base-color underline) underline)
:plist plist))

(defun ensure-attribute (x &optional (errorp t))
(cond ((symbolp x)
Expand All @@ -72,7 +74,9 @@
:reverse (or (attribute-reverse over)
(attribute-reverse under))
:underline (or (attribute-underline over)
(attribute-underline under))))
(attribute-underline under))
:plist (append (attribute-plist over)
(attribute-plist under))))

(defun attribute-equal (attribute1 attribute2)
(and (equal (attribute-foreground attribute1)
Expand Down