commit 918aebf431a91dee185836b1cc254e96c406d3e1
parent c3f70023597f7ea320e994afa0838a603bf52324
Author: Kyle Milz <kyle@0x30.net>
Date: Thu, 28 Jul 2016 19:24:11 -0600
src/term: add lower bounds check to scrolling
Diffstat:
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/term_main.cc b/src/term_main.cc
@@ -72,13 +72,6 @@ main(int argc, char *argv[])
assert(frame_deltas.size() == 50);
assert(execution_history.size() == 50);
- // Non-blocking due to nodelay() above.
- int ch = getch();
- if (ch == 'j')
- offset++;
- else if (ch == 'k' && offset > 0)
- offset--;
-
erase();
conn.read_executions();
@@ -111,6 +104,14 @@ main(int argc, char *argv[])
attroff(COLOR_PAIR(color));
}
+ // Non-blocking due to nodelay() above.
+ int ch = getch();
+ if (ch == 'j' && offset < (t.num_lines - size_y - 1))
+ offset++;
+ else if (ch == 'k' && offset > 0)
+ offset--;
+
+
move(size_y - 1, 0);
clrtoeol();