diff --git a/org/channel-tui-view.org b/org/channel-tui-view.org index 367f47d..f22206d 100644 --- a/org/channel-tui-view.org +++ b/org/channel-tui-view.org @@ -327,9 +327,13 @@ Returns a list of strings, one per line." (cl-tty.backend:end-sync fb) (setf (st :dirty) (list nil nil nil)))) +(defun cursor-visible-p () + "Returns T if the software-cursor should be visible this frame (2Hz)." + (evenp (floor (get-internal-real-time) + (floor internal-time-units-per-second 2)))) + (defun position-cursor (fb w h) - "Position terminal cursor at the input insertion point. -Terminal handles the blinking — we just set position and style once per frame." + "Position terminal cursor at input insertion point and draw █ software cursor." (let* ((sw (if (sidebar-visible-p w) (or (st :sidebar-width) 42) 0)) (cw (- w sw)) (hpad 2) @@ -341,7 +345,8 @@ Terminal handles the blinking — we just set position and style once per frame. (cy (- h 6))) (cl-tty.backend:cursor-move fb cx cy) (cl-tty.backend:cursor-style fb :block :blink t) - (cl-tty.backend:cursor-show fb))) + ;; Software █ cursor — erase old position with space, draw new position + (cl-tty.backend:draw-text fb cx cy (if (cursor-visible-p) "█" " ") (theme-color :input-fg) nil))) #+END_SRC * Implementation — v0.7.0 additions