v0.12.0: Terminal capability detection, GPL 3.0 license, roadmap rewrite
LICENSE: - Added GNU General Public License v3.0 - Updated README.org to reflect GPL 3.0 ROADMAP: - Complete rewrite to reflect actual project state - Removed croatoan/ncurses/Yoga FFI references - Marked all 11 existing versions DONE - Added v0.12.0-0.14.0 for new features (detection, pipeline, mouse) DETECTION (v0.12.0): - detect-backend: auto-detect modern vs simple backend - detect-backend-by-env: check COLORTERM env var - detect-backend-by-tty: check interactive-stream-p - detect-backend-by-da1: query terminal via ESC[c (best-effort) - *detected-backend* cache for zero-cost subsequent calls - Added detection.lisp to ASDF and package exports - Added 2 new tests (360 total, all passing) - demo.lisp updated to use detect-backend ORG BACKPORT (pre-existing fixes synced): - dialog.org: render-dialog/render-toast fixes, class initforms - scrollbox-tabbar.org: background-element -> bright-black, remove duplicate render - select.org: remove duplicate render export - text-input.org: remove duplicate %split-string, undo overflow fix - layout-engine.org: quoted-literal -> list constructors, normalize-box rewrite - mouse.org: add missing exports, fix test
This commit is contained in:
@@ -1307,14 +1307,15 @@ onto the redo stack, and restores the old value. ~textarea-redo~ does
|
||||
the reverse.
|
||||
|
||||
The ~(>= (length stack) (array-total-size stack))~ guard prevents the
|
||||
stack from growing beyond 100 entries by resetting it.
|
||||
stack from growing beyond 100 entries by dropping the oldest entry.
|
||||
|
||||
#+BEGIN_SRC lisp
|
||||
(defun textarea-push-undo (ta)
|
||||
(let ((stack (textarea-undo-stack ta)))
|
||||
(when (>= (length stack) (array-total-size stack))
|
||||
(setf (textarea-undo-stack ta)
|
||||
(make-array 100 :fill-pointer 0)))
|
||||
(loop for i from 1 below (length stack)
|
||||
do (setf (aref stack (1- i)) (aref stack i)))
|
||||
(decf (fill-pointer stack)))
|
||||
(vector-push (textarea-value ta) stack)
|
||||
(setf (fill-pointer (textarea-redo-stack ta)) 0)))
|
||||
|
||||
@@ -2050,17 +2051,6 @@ experience; this section is what actually generates the compilable code.
|
||||
#+BEGIN_SRC lisp :tangle ../src/components/textarea.lisp
|
||||
(in-package #:cl-tty.input)
|
||||
|
||||
;;; ---------------------------------------------------------------------------
|
||||
;;; Utility: split string (local copy for dependency-free operation)
|
||||
;;; ---------------------------------------------------------------------------
|
||||
(defun %split-string (string separator)
|
||||
"Split STRING at each occurrence of SEPARATOR. Returns list of strings."
|
||||
(loop with start = 0
|
||||
for pos = (position separator string :start start)
|
||||
collect (subseq string start pos)
|
||||
while pos
|
||||
do (setf start (1+ pos))))
|
||||
|
||||
;;; ---------------------------------------------------------------------------
|
||||
;;; Textarea class
|
||||
;;; ---------------------------------------------------------------------------
|
||||
@@ -2219,10 +2209,10 @@ experience; this section is what actually generates the compilable code.
|
||||
"Save current value on undo stack."
|
||||
(let ((stack (textarea-undo-stack ta)))
|
||||
(when (>= (length stack) (array-total-size stack))
|
||||
(setf (textarea-undo-stack ta)
|
||||
(make-array 100 :fill-pointer 0)))
|
||||
(loop for i from 1 below (length stack)
|
||||
do (setf (aref stack (1- i)) (aref stack i)))
|
||||
(decf (fill-pointer stack)))
|
||||
(vector-push (textarea-value ta) stack)
|
||||
;; Clear redo stack on new action
|
||||
(setf (fill-pointer (textarea-redo-stack ta)) 0)))
|
||||
|
||||
(defun textarea-undo (ta)
|
||||
|
||||
Reference in New Issue
Block a user