Commit 06abe2cd35bd9a0a6696218ef52035866e7a6593

Stefan Sperling 2018-05-10T14:49:40

fix single-step downwards scrolling in tog; broken by previous

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/tog/tog.c b/tog/tog.c
index d8bdfb1..aee813b 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -622,11 +622,11 @@ show_log_view(struct got_object_id *start_id, struct got_repository *repo)
 			case 'j':
 			case KEY_DOWN:
 				nparents = num_parents(first_displayed_entry);
-				if (selected >= nparents - 1)
-					break;
-				if (selected < LINES - 1)
+				if (selected < LINES - 1 &&
+				    selected < nparents - 1)
 					selected++;
-				if (selected < LINES - 1)
+				if (selected < LINES - 1 &&
+				    selected < nparents - 1)
 					break;
 				err = scroll_down(&first_displayed_entry, 1,
 				    last_displayed_entry, &commits, repo);