about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-03-09 10:01:22 -0800
committerKartik K. Agaram <vc@akkartik.com>2017-03-09 10:01:22 -0800
commit053ffdc6922125cdd26eab7b919fe2f3734c5bcd (patch)
tree4a3585a1d878be465414bb013be04ef8b5e896f5
parentab146dd2652d17b1b1aace631715c84eb009f460 (diff)
downloadmu-053ffdc6922125cdd26eab7b919fe2f3734c5bcd.tar.gz
3773 - trace-browser bugfix
-rw-r--r--100trace_browser.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/100trace_browser.cc b/100trace_browser.cc
index 7d62fe14..90fc1287 100644
--- a/100trace_browser.cc
+++ b/100trace_browser.cc
@@ -115,10 +115,14 @@ void start_trace_browser() {
     else if (key == 'c') {
       // move cursor to center of screen
       Display_row = tb_height()/2;
+      while (!contains_key(Trace_index, Display_row))
+        --Display_row;
     }
     else if (key == 'b') {
       // move cursor to bottom of screen
       Display_row = tb_height()-1;
+      while (!contains_key(Trace_index, Display_row))
+        --Display_row;
     }
     else if (key == 'T') {
       // scroll line at cursor to top of screen