commit df68a56be62fb658f8307fc5321e12b7b9fce746 from: Mark Jamsek date: Fri Aug 12 12:57:21 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 - 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,