fix: replace draw-rect on framebuffer with draw-text

draw-rect has no method on raw arrays (only on framebuffer-backend,
simple-backend, modern-backend). Three calls in view-status, view-chat,
and view-sidebar passed the framebuffer array to draw-rect, causing
'no applicable method' crash on startup.

Replaced with (draw-text ... (make-string w #\Space) nil bg) which
fills the same area with background spaces.
This commit is contained in:
2026-05-13 19:20:00 -04:00
parent 15d16fd520
commit b17c501231
2 changed files with 6 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ Returns a list of strings, one per line."
(or (st :foveal-id) "passepartout") (or (st :rule-count) 0)))
(right (format nil "$~,2f ~a" (or (st :session-cost) 0.0) (now))))
(dotimes (col w)
(cl-tty.backend:draw-rect fb col (- h 1) 1 1 :bg bg))
(cl-tty.backend:draw-text fb 0 (- h 1) (make-string w :initial-element #\Space) nil bg))
(cl-tty.backend:draw-text fb 1 (- h 1) left fg nil)
(cl-tty.backend:draw-text fb (- w (length right) 2) (- h 1) right fg nil)))
@@ -151,7 +151,7 @@ Returns a list of strings, one per line."
(dolist (pair pairs)
(when (>= y (- h 4)) (return))
(destructuring-bind (text color &optional bg) pair
(when bg (cl-tty.backend:draw-rect fb 0 y w 1 :bg bg))
(when bg (cl-tty.backend:draw-text fb 0 y (make-string w :initial-element #\Space) nil bg))
(cl-tty.backend:draw-text fb 0 y text color nil))
(incf y)))))))))
@@ -170,7 +170,7 @@ Returns a list of strings, one per line."
(y 0))
;; Vertical separator
(dotimes (row h)
(cl-tty.backend:draw-rect fb (1- x) row 1 1 :bg (theme-color :separator)))
(cl-tty.backend:draw-text fb (1- x) row " " nil (theme-color :separator)))
;; Focus panel
(cl-tty.backend:draw-text fb (1+ x) (incf y) " FOCUS" (theme-color :accent) nil)
(incf y)