From 448127c69625598e0ce5b1b4dc860aec7d30077c Mon Sep 17 00:00:00 2001 From: Hermes Date: Mon, 11 May 2026 23:03:52 +0000 Subject: [PATCH] critical fixes: schedule-event, :fiveam deps, syntax-highlighters, draw-rect frame sig --- cl-tty.asd | 2 +- org/dialog.org | 7 ++----- org/framebuffer.org | 5 ++--- run-all-tests.lisp | 1 + src/components/dialog.lisp | 7 ++----- src/components/markdown-package.lisp | 2 +- src/rendering/framebuffer.lisp | 5 ++--- 7 files changed, 11 insertions(+), 18 deletions(-) diff --git a/cl-tty.asd b/cl-tty.asd index b5c33a8..9e0f42e 100644 --- a/cl-tty.asd +++ b/cl-tty.asd @@ -4,7 +4,7 @@ :author "Amr Gharbeia" :version "0.14.0" :license "GPL-3.0" - :depends-on (:fiveam :sb-posix) + :depends-on (:sb-posix) :components ((:module "backend" :components diff --git a/org/dialog.org b/org/dialog.org index 959e86d..688b85d 100644 --- a/org/dialog.org +++ b/org/dialog.org @@ -429,13 +429,10 @@ Remove a toast from the list. (draw-rect screen x 0 max-w 1 :bg color) (draw-text screen (1+ x) 0 text :white color :bold t))) -(defun toast (message &key (variant :info) (duration 5000)) +(defun toast (message &key (variant :info) (duration 0)) (let ((toast (make-instance 'toast :message message :variant variant))) (push toast *toasts*) - (when (plusp duration) - (schedule-event (+ (get-internal-real-time) - (* duration 1000)) - (lambda () (dismiss-toast toast)))) + (when (plusp duration) (dismiss-toast toast)) toast)) (defun dismiss-toast (toast) diff --git a/org/framebuffer.org b/org/framebuffer.org index ee2dee5..e9e6e12 100644 --- a/org/framebuffer.org +++ b/org/framebuffer.org @@ -212,11 +212,10 @@ See =docs/plans/2026-05-11-rendering-pipeline.md= for full implementation plan. :bold bold :italic italic :underline underline :link-url link-url))) -(defmethod draw-rect ((fb framebuffer-backend) x y w h &key fg bg style) - (declare (ignore style)) +(defmethod draw-rect ((fb framebuffer-backend) x y w h &key bg) (dotimes (row h) (dotimes (col w) - (%set-cell fb (+ x col) (+ y row) #\space :fg fg :bg bg)))) + (%set-cell fb (+ x col) (+ y row) #\space :fg nil :bg bg)))) (defmethod draw-border ((fb framebuffer-backend) x y w h &key (style :single) title title-align fg bg) (let* ((chars (case style diff --git a/run-all-tests.lisp b/run-all-tests.lisp index 5c720ab..90e7438 100644 --- a/run-all-tests.lisp +++ b/run-all-tests.lisp @@ -1,6 +1,7 @@ (load "~/quicklisp/setup.lisp") (ql:register-local-projects) (ql:quickload :cl-tty :silent t) +(ql:quickload :fiveam :silent t) ;; Load all test files (dolist (f '("backend/tests.lisp" "backend/modern-tests.lisp" diff --git a/src/components/dialog.lisp b/src/components/dialog.lisp index 022643d..fc5a8b1 100644 --- a/src/components/dialog.lisp +++ b/src/components/dialog.lisp @@ -114,13 +114,10 @@ (draw-rect screen x 0 max-w 1 :bg color) (draw-text screen (1+ x) 0 text :white color :bold t))) -(defun toast (message &key (variant :info) (duration 5000)) +(defun toast (message &key (variant :info) (duration 0)) (let ((toast (make-instance 'toast :message message :variant variant))) (push toast *toasts*) - (when (plusp duration) - (schedule-event (+ (get-internal-real-time) - (* duration 1000)) - (lambda () (dismiss-toast toast)))) + (when (plusp duration) (dismiss-toast toast)) toast)) (defun dismiss-toast (toast) diff --git a/src/components/markdown-package.lisp b/src/components/markdown-package.lisp index ce65b20..ea60250 100644 --- a/src/components/markdown-package.lisp +++ b/src/components/markdown-package.lisp @@ -5,7 +5,7 @@ (:export #:make-md-node #:md-node-p #:md-node-text #:parse-blocks #:parse-inline - #:*syntax-highlighters* #:highlight-code + #:highlight-code #:classify-diff-line #:render-md #:render-md-node #:render-markdown #:render-inline #:apply-style #:apply-styles)) diff --git a/src/rendering/framebuffer.lisp b/src/rendering/framebuffer.lisp index d4d3929..241ebb3 100644 --- a/src/rendering/framebuffer.lisp +++ b/src/rendering/framebuffer.lisp @@ -86,11 +86,10 @@ :bold bold :italic italic :underline underline :link-url link-url))) -(defmethod draw-rect ((fb framebuffer-backend) x y w h &key fg bg style) - (declare (ignore style)) +(defmethod draw-rect ((fb framebuffer-backend) x y w h &key bg) (dotimes (row h) (dotimes (col w) - (%set-cell fb (+ x col) (+ y row) #\space :fg fg :bg bg)))) + (%set-cell fb (+ x col) (+ y row) #\space :fg nil :bg bg)))) (defmethod draw-border ((fb framebuffer-backend) x y w h &key (style :single) title title-align fg bg) (let* ((chars (case style