From e8b0d7ab564c1a2cc3c8a96db87a8ba04e924b6e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 6 Sep 2015 12:31:56 -0700 Subject: 2172 - 'main' for 'mu edit' running just layer 1 Takes the text to render inside the editor on the commandline: $ ./mu edit/001-editor.mu -- abcdef Layer 1 has no interactivity. Just shows the text you pass in on the commandline, wrapping as you would expect. Press any key to exit. --- edit/001-editor.mu | 13 +++++++++++++ edit/004-programming-environment.mu | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'edit') diff --git a/edit/001-editor.mu b/edit/001-editor.mu index 4724737d..8f41c5c1 100644 --- a/edit/001-editor.mu +++ b/edit/001-editor.mu @@ -1,5 +1,18 @@ ## the basic editor data structure, and how it displays text to the screen +# temporary main for this layer: just render the given string at the given +# screen dimensions, then stop +recipe! main [ + local-scope + text:address:array:character <- next-ingredient + open-console + hide-screen 0/screen + new-editor text, 0/screen, 0/left, 5/right + show-screen 0/screen + wait-for-event 0/console + close-console +] + scenario editor-initially-prints-string-to-screen [ assume-screen 10/width, 5/height run [ diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu index 5babc9e3..5b6751aa 100644 --- a/edit/004-programming-environment.mu +++ b/edit/004-programming-environment.mu @@ -3,7 +3,7 @@ # Consists of one editor on the left for recipes and one on the right for the # sandbox. -recipe main [ +recipe! main [ local-scope open-console initial-recipe:address:array:character <- restore [recipes.mu] -- cgit 1.4.1-2-gfad0