about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-27 16:02:52 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-27 16:02:52 -0700
commitbb27fd0a0c5e0ea39f267c4106f36c80465fd14b (patch)
treee1fb676bb63056afb8b3721649446d422a188637
parent0e120d8153a28f825a74d0c976c9d2f208e9e267 (diff)
downloadmu-bb27fd0a0c5e0ea39f267c4106f36c80465fd14b.tar.gz
1487 - repl working interactively
-rw-r--r--070display.cc6
-rw-r--r--repl.mu5
2 files changed, 6 insertions, 5 deletions
diff --git a/070display.cc b/070display.cc
index a9df09c5..fd96733a 100644
--- a/070display.cc
+++ b/070display.cc
@@ -92,15 +92,15 @@ case PRINT_CHARACTER_TO_DISPLAY: {
     }
     break;
   }
-  int color = TB_WHITE;
+  int color = TB_DEFAULT;
   if (SIZE(ingredients) > 1) {
     assert(scalar(ingredients.at(1)));
-    color = ingredients.at(1).at(0);
+    color = ingredients.at(1).at(0)+1/*skip default*/;
 //?     tb_shutdown(); //? 1
 //?     cerr << "AAA " << color << '\n'; //? 1
 //?     exit(1); //? 1
   }
-  tb_change_cell(Display_column, Display_row, c, 7, TB_DEFAULT);
+  tb_change_cell(Display_column, Display_row, c, color, TB_DEFAULT);
   if (Display_column < width-1) {
     ++Display_column;
     tb_set_cursor(Display_column, Display_row);
diff --git a/repl.mu b/repl.mu
index fb66f3ee..bc686ecd 100644
--- a/repl.mu
+++ b/repl.mu
@@ -12,7 +12,6 @@ recipe main [
     0:literal/real-screen <- print-string 0:literal/real-screen, inst:address:array:character
     loop
   }
-  wait-for-key-from-keyboard
   return-to-console
 ]
 
@@ -45,10 +44,10 @@ recipe read-instruction [
   x:address:screen <- next-ingredient
   result:address:buffer <- init-buffer 10:literal  # string to maybe add to
   {
+    # read character
     c:character, k:address:keyboard <- wait-for-key k:address:keyboard
 #?     $print c:character, [ 
 #? ] #? 1
-    print-character x:address:screen, c:character
     # quit?
     {
       ctrl-d?:boolean <- equal c:character, 4:literal/ctrl-d/eof
@@ -60,6 +59,8 @@ recipe read-instruction [
       break-unless null?:boolean
       reply 0:literal, k:address:keyboard/same-as-ingredient:0, x:address:screen/same-as-ingredient:1
     }
+    # print
+    print-character x:address:screen, c:character
     # append
     result:address:buffer <- buffer-append result:address:buffer, c:character
     # done with this instruction?