Commit Diff


commit - 631e7531fb307436e7797fdf83128e94367ee807
commit + df68a56be62fb658f8307fc5321e12b7b9fce746
blob - d36f81499f5b4ae7861ea0f9202c777e7c4787e8
blob + 031ac318e747e847486fee09904105717f3d1a39
--- tog/tog.c
+++ tog/tog.c
@@ -6365,9 +6365,11 @@ draw_tree_entries(struct tog_view *view, const char *p
 	free(wline);
 	wline = NULL;
 
-	if (s->selected_entry) {
-		i = got_tree_entry_get_index(s->selected_entry);
-		i += s->tree == s->root ? 1 : 2;  /* account for ".." entry */
+	i += s->selected;
+	if (s->first_displayed_entry) {
+		i += got_tree_entry_get_index(s->first_displayed_entry);
+		if (s->tree != s->root)
+			++i;  /* account for ".." entry */
 	}
 	nentries = got_object_tree_get_nentries(s->tree);
 	wprintw(view->window, " [%d/%d]", i,