add cursor buffer and cursor program to imperative shell

This commit is contained in:
2024-10-09 11:22:39 +01:00
parent 418adc4502
commit 9d7d00e8d1
4 changed files with 98 additions and 14 deletions

View File

@@ -12,6 +12,20 @@ struct
val ySpace = 25
val fontSize = 30.0
fun buildTextAccToDrawMsg (textAcc, cursorAcc) =
let
open MailboxType
open DrawMsg
val textAcc = Vector.concat textAcc
val cursorAcc = Vector.concat cursorAcc
val textMsg = REDRAW_TEXT textAcc
val cursorMsg = REDRAW_CURSOR cursorAcc
in
[DRAW textMsg, DRAW cursorMsg]
end
(* builds text from a string with char-wrap.
* char-wrap is a similar concept to word-wrap,
* but it breaks on character in the middle of a word.