commit 6f5f393a4c4429e6729a0e6b3d7353c5cc29ccb4 from: Mark Jamsek via: Thomas Adam date: Fri Aug 12 17:06:29 2022 UTC tog: fix delayed tree index update If a child blame view has been opened, halfdelay() is reset to a 1 second refresh rate, so the index in the header lags behind subtree navigation as we set the index based on the selected tree entry, which isn't updated till that refresh cycle completes. Don't wait for the selected_entry to update; instead, compute the index from the first displayed entry and the currently selected line index. improved by and ok stsp@ commit - 7ed048bd205ddb22d99df94e64ca3354aba2166e commit + 6f5f393a4c4429e6729a0e6b3d7353c5cc29ccb4 blob - 5184abe65931a16acddc67da33dc1e06150f0964 blob + 7e9b6f467a1a75890b6688e3316de4fcb67d36f6 --- tog/tog.c +++ tog/tog.c @@ -6370,9 +6370,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,