line-read: suggestions, keys for the caller, initial input; 0.1.2

#:suggester shows a suggestion after the input, dimmed, as fish does. Right,
C-f, End and C-e at the end accept it; M-f, C-Right and M-Right one word.
#:command-key? hands keys to the caller as (LineKey key input), with the
input erased. line-read and simulate-line take #:initial.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Linus Björnstam 2026-12-01 13:07:56 +01:00
parent dc8a3325b8
commit 3021b14aac
7 changed files with 198 additions and 38 deletions

View file

@ -48,7 +48,8 @@
(str (match result
((LineText text) (str "read " (written text)))
(LineEof "eof")
(LineCancelled "cancelled"))
(LineCancelled "cancelled")
((LineKey _ _) "key"))
(if (> n 5) ", ticks ran" ", no ticks")))
(: (-> LineEditor Terminal string))