Commit 80ee46039aad5490fab4f020f562d807f8e9f6b4

Stefan Sperling 2018-05-10T14:37:53

disallow single-step scrolling beyond available commits in tog

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/tog/tog.c b/tog/tog.c
index bbec670..7f8c1b8 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -617,6 +617,9 @@ show_log_view(struct got_object_id *start_id, struct got_repository *repo)
 				break;
 			case 'j':
 			case KEY_DOWN:
+				nparents = num_parents(first_displayed_entry);
+				if (selected >= nparents - 1)
+					break;
 				if (selected < LINES - 1)
 					selected++;
 				if (selected < LINES - 1)