about summary refs log tree commit diff stats
path: root/070display.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-08-12 13:49:51 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-08-12 13:49:51 -0700
commitfec4d874aea40f17b57a4659e0770303842543b6 (patch)
treef4006b3462df50e6560abafe647538716ed2ef73 /070display.cc
parent66b14a032297b67e5ac0c06ee3c794f78e154b57 (diff)
downloadmu-fec4d874aea40f17b57a4659e0770303842543b6.tar.gz
1981 - clear screen below editors in C
Environment much more responsive now. And it doesn't slow down as much
just because I'm on a larger screen.
Diffstat (limited to '070display.cc')
-rw-r--r--070display.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/070display.cc b/070display.cc
index ce6d657f..b32af983 100644
--- a/070display.cc
+++ b/070display.cc
@@ -369,3 +369,26 @@ case INTERACTIONS_LEFT: {
   products.at(0).push_back(tb_event_ready());
   break;
 }
+
+//: a hack to make edit.mu more responsive
+
+:(before "End Primitive Recipe Declarations")
+CLEAR_DISPLAY_FROM,
+:(before "End Primitive Recipe Numbers")
+Recipe_ordinal["clear-display-from"] = CLEAR_DISPLAY_FROM;
+:(before "End Primitive Recipe Implementations")
+case CLEAR_DISPLAY_FROM: {
+  // todo: error checking
+  int row = ingredients.at(0).at(0);
+  int column = ingredients.at(1).at(0);
+  int left = ingredients.at(2).at(0);
+  int right = ingredients.at(3).at(0);
+  int height=tb_height();
+  for (; row < height; ++row, column=left) {  // start column from left in every inner loop except first
+    for (; column <= right; ++column) {
+      tb_change_cell(column, row, ' ', TB_WHITE, TB_BLACK);
+    }
+  }
+  if (Autodisplay) tb_present();
+  break;
+}