diff --git a/src/display-2.lisp b/src/display-2.lisp index 3857f7d0f..f5a3c3383 100644 --- a/src/display-2.lisp +++ b/src/display-2.lisp @@ -66,7 +66,8 @@ (lem-core:overlay-get overlay :cursor)) (defun cursor-attribute-p (attribute) - (lem-core:attribute-value attribute :cursor)) + (and (lem-core:attribute-p attribute) + (lem-core:attribute-value attribute :cursor))) (defun set-cursor-attribute (attribute) (setf (lem-core:attribute-value attribute :cursor) t)) @@ -219,9 +220,7 @@ :for (start end attribute) :in attributes :do (unless (= last-pos start) (add (make-string-with-attribute-item :string (subseq string last-pos start)))) - (add (if (and attribute - (lem-core:attribute-p attribute) - (cursor-attribute-p attribute)) + (add (if (cursor-attribute-p attribute) (make-cursor-item :string (subseq string start end) :attribute attribute) (make-string-with-attribute-item :string (subseq string start end) diff --git a/src/display-3.lisp b/src/display-3.lisp index 5cfa02496..c1e535321 100644 --- a/src/display-3.lisp +++ b/src/display-3.lisp @@ -199,7 +199,7 @@ :finally (return (nreverse items)))) (defun make-line-end-object (string attribute type offset) - (let ((attribute (and attribute (lem-core:ensure-attribute attribute)))) + (let ((attribute (and attribute (lem-core:ensure-attribute attribute nil)))) (make-instance 'line-end-object :offset offset :string string @@ -207,7 +207,7 @@ :type type))) (defun make-object-with-type (string attribute type) - (let ((attribute (and attribute (lem-core:ensure-attribute attribute)))) + (let ((attribute (and attribute (lem-core:ensure-attribute attribute nil)))) (make-instance (case type (:folder 'folder-object) (:icon 'icon-object)