about summary refs log tree commit diff stats
path: root/edit/001-editor.mu
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/001-editor.mu
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/001-editor.mu')
-rw-r--r--edit/001-editor.mu13
1 files changed, 13 insertions, 0 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 [