line-read: draw input taller than the screen in part

- input-window chooses the rows to draw: the window stays while the
  cursor is in it and moves the least it must. A marker row at each end
  with hidden rows gives their count.
- The cursor can always go up to the first row drawn, so redrawing no
  longer leaves copies of the input in the scrollback.
- The accepted input is drawn whole.
- layout returns the text of each row.
- New tests: input-window in tests/line.bjo, and tests/tall.bjo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Linus Björnstam 2026-11-30 21:35:16 +01:00
parent 95d747cf70
commit 566008e264
5 changed files with 181 additions and 25 deletions

View file

@ -35,6 +35,7 @@ Examples:
- `tests/text.bjo`: clusters and widths.
- `tests/reflow.bjo`: the redraw after the terminal narrows, with and
without reflow, under `script`.
- `tests/tall.bjo`: input taller than the screen, under `script`.
- `tests/async.bjo`: `line-read` in a bjoroutine, and cancelled by a
deadline.
- `examples/keys.bjo` prints events; `examples/repl.bjo` is a small REPL.