handle multiline text output properly
This commit is contained in:
parent
db65e7c5e2
commit
a247c89332
1 changed files with 4 additions and 1 deletions
|
|
@ -47,7 +47,10 @@ that the DOM and running scripts can be modified.
|
||||||
|
|
||||||
PROMPT specifies the user prompt."
|
PROMPT specifies the user prompt."
|
||||||
(let* ((add-line (lambda (state text prompt?)
|
(let* ((add-line (lambda (state text prompt?)
|
||||||
(set! state.lines (cons `&(:text ,text :prompt ,prompt?) state.lines))))
|
(map
|
||||||
|
(lambda (l)
|
||||||
|
(set! state.lines (cons `&(:text ,l :prompt ,prompt?) state.lines)))
|
||||||
|
(string-split "\n" text))))
|
||||||
(evaluate (lambda (state cmd)
|
(evaluate (lambda (state cmd)
|
||||||
(add-line state (format "~a~a" prompt cmd) #t)
|
(add-line state (format "~a~a" prompt cmd) #t)
|
||||||
(let ((res (eval (with-input-from-string cmd read))))
|
(let ((res (eval (with-input-from-string cmd read))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue