Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cxxxr committed Sep 29, 2023
1 parent 0618dbb commit f98db64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/display-2.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/display-3.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@
: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
:attribute attribute
: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)
Expand Down

0 comments on commit f98db64

Please sign in to comment.