zygo

ncurses gopher client
Log | Files | Refs

commit c8c0f87388dc1ad3aacf46470fb0cf5da2243f32
parent d86b6196fff98338983c69c8ca0b259dd1283a34
Author: hhvn <dev@hhvn.uk>
Date:   Sat, 22 Jan 2022 23:11:48 +0000

zygo.c: always be able to scroll to last line

Diffstat:
Mzygo.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/zygo.c b/zygo.c @@ -982,7 +982,7 @@ run(void) { switch (c) { case KEY_DOWN: case 'j': - if (list_len(&page) - ui.scroll > LINES) + if (list_len(&page) - ui.scroll > LINES - 1) ui.scroll++; draw_page(); break; @@ -991,7 +991,7 @@ run(void) { if (list_len(&page) - ui.scroll > ((int)LINES * 1.5)) ui.scroll += ((int)LINES / 2); else if (list_len(&page) > LINES) - ui.scroll = list_len(&page) - LINES; + ui.scroll = list_len(&page) - LINES + 1; draw_page(); break; case KEY_UP: @@ -1033,8 +1033,8 @@ run(void) { draw_page(); break; case 'G': - if (list_len(&page) > LINES) - ui.scroll = list_len(&page) - LINES; + if (list_len(&page) > LINES - 1) + ui.scroll = list_len(&page) - LINES + 1; draw_page(); break; case 'n':