diff options
Diffstat (limited to '077trace_browser.cc')
-rw-r--r-- | 077trace_browser.cc | 17 |
1 files changed, 15 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(); |