"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
tog log: correct number of lines to page up/down
To:
gameoftrees@openbsd.org
Date:
Mon, 23 Mar 2020 15:55:26 +0100

Download raw body.

Thread
Subtract the status line from the number of lines to page up/down in the
log view.
ok?

Currently, page up/down moves by one line too many.

diff 2ce013e7b4e59784635e0d0fe7d81341651ff3d3 /home/naddy/got
blob - aa1595fa7c1bda2eb019f9949051396fed7fc58a
file + tog/tog.c
--- tog/tog.c
+++ tog/tog.c
@@ -2273,7 +2273,7 @@ input_log_view(struct tog_view **new_view, struct tog_
 			break;
 		}
 		scroll_up(view, &s->first_displayed_entry,
-		    view->nlines, &s->commits);
+		    view->nlines - 1, &s->commits);
 		break;
 	case 'j':
 	case KEY_DOWN:
@@ -2299,7 +2299,7 @@ input_log_view(struct tog_view **new_view, struct tog_
 		if (first == NULL)
 			break;
 		err = scroll_down(view, &s->first_displayed_entry,
-		    view->nlines, &s->last_displayed_entry,
+		    view->nlines - 1, &s->last_displayed_entry,
 		    &s->commits, &s->thread_args.log_complete,
 		    &s->thread_args.commits_needed,
 		    &s->thread_args.need_commits);
-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de