mudgangster

Log | Files | Refs

commit cd37597d9a58f976630a03facc79a1922224c3ec
parent 5bc0c3dbd709e33890166067b7201940e731a509
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Tue,  4 Sep 2018 13:33:43 +0300

Don't loop around to new text when at the top of the scrollback buffer

Diffstat:
src/textbox.cc | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/textbox.cc b/src/textbox.cc @@ -119,7 +119,7 @@ void textbox_draw( const TextBox * tb ) { size_t tb_rows = num_rows( tb->h ); size_t tb_cols = tb->w / fw; - while( rows_drawn < tb_rows && lines_drawn < tb->num_lines ) { + while( rows_drawn < tb_rows && lines_drawn + tb->scroll_offset < tb->num_lines ) { const TextBox::Line & line = tb->lines[ ( tb->head + tb->num_lines - tb->scroll_offset - lines_drawn ) % tb->max_lines ]; size_t line_rows = 1 + line.len / tb_cols;