about summary refs log tree commit diff stats
path: root/edit
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-09-06 12:31:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-09-06 12:31:56 -0700
commite8b0d7ab564c1a2cc3c8a96db87a8ba04e924b6e (patch)
treed229709d0913aa10d700af0e6cc995624213f5bf /edit
parentcea49fdee2835c366b917125cd496ac7f0d09232 (diff)
downloadmu-e8b0d7ab564c1a2cc3c8a96db87a8ba04e924b6e.tar.gz
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.
Diffstat (limited to 'edit')
-rw-r--r--edit/001-editor.mu13
-rw-r--r--edit/004-programming-environment.mu2
2 files changed, 14 insertions, 1 deletions
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]