about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-28 18:11:28 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-28 18:11:28 -0700
commit63030ea7e4f4dc92d37adf7a721fc63679f2be0a (patch)
tree4c4e001e29c2d800b0fb696b43039788d60834a9
parent8183efcf1e70cd98297189b28aadf83148caa1b1 (diff)
downloadmu-63030ea7e4f4dc92d37adf7a721fc63679f2be0a.tar.gz
1509
Ah, the failing test isn't what I thought. This is a regression.
Let's debug this using the trace-browser! Little tweak as I use it.
-rw-r--r--077trace_browser.cc17
-rw-r--r--repl.mu3
2 files changed, 18 insertions, 2 deletions
diff --git a/077trace_browser.cc b/077trace_browser.cc
index 024e5e63..6819a473 100644
--- a/077trace_browser.cc
+++ b/077trace_browser.cc
@@ -71,10 +71,9 @@ void start_trace_browser() {
     }
     if (key == 'K') {
       // page-up is more convoluted
-      int max = tb_height();
 //?       tb_shutdown(); //? 1
 //?       cerr << "page-up: Top_of_screen is currently " << Top_of_screen << '\n'; //? 1
-      for (int screen_row = max; screen_row > 0 && Top_of_screen > 0; --screen_row) {
+      for (int screen_row = tb_height(); screen_row > 0 && Top_of_screen > 0; --screen_row) {
         --Top_of_screen;
         if (Top_of_screen <= 0) break;
         while (Top_of_screen > 0 && Visible.find(Top_of_screen) == Visible.end())
@@ -85,6 +84,20 @@ void start_trace_browser() {
       if (Top_of_screen > 0)
         refresh_screen_rows();
     }
+    if (key == 'G') {
+      // go to bottom of screen; largely like page-up, interestingly
+      Top_of_screen = SIZE(Trace_stream->past_lines)-1;
+      for (int screen_row = tb_height(); screen_row > 0 && Top_of_screen > 0; --screen_row) {
+        --Top_of_screen;
+        if (Top_of_screen <= 0) break;
+        while (Top_of_screen > 0 && Visible.find(Top_of_screen) == Visible.end())
+          --Top_of_screen;
+      }
+      refresh_screen_rows();
+      // move cursor to bottom
+      Display_row = Last_printed_row;
+      refresh_screen_rows();
+    }
     if (key == TB_KEY_CARRIAGE_RETURN) {
       // expand lines under current by one level
 //?       tb_shutdown();
diff --git a/repl.mu b/repl.mu
index 66d58245..a06162f6 100644
--- a/repl.mu
+++ b/repl.mu
@@ -478,7 +478,10 @@ scenario read-instruction-color-string-inside-string [
   assume-keyboard [abc [string [inner string]]
 ]
   run [
+#?     $start-tracing #? 1
     read-instruction keyboard:address, screen:address
+#?     $stop-tracing #? 1
+    $browse-trace
   ]
   screen-should-contain [
     .abc [string [inner string]]   .