Commit ea66598afcb6fd0bfa2c6cad9532450223c85054

Christian Weisgerber 2021-09-03T21:41:22

tog: jump directly to first log item instead of traversing the list ok tracey

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/tog/tog.c b/tog/tog.c
index 6571f11..bca3ff7 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2420,11 +2420,8 @@ input_log_view(struct tog_view **new_view, struct tog_view *view, int ch)
 		break;
 	case 'g':
 	case KEY_HOME:
-		if (s->first_displayed_entry == NULL)
-			break;
-
 		s->selected = 0;
-		log_scroll_up(s, s->commits.ncommits);
+		s->first_displayed_entry = TAILQ_FIRST(&s->commits.head);
 		select_commit(s);
 		break;
 	case KEY_PPAGE: