commit bf5b33f40e876afe41fd486ff5d3eb182dfaf046 from: Omar Polo date: Tue Jan 18 14:09:18 2022 UTC correctly save scrolling position Before we didn't save the scrolling position before a refresh (nohist=1) and that's annoying. This saves the scrolling position only in the correct case, which is when changing from a page to another, expect when switching to TAB_LAZY off. commit - fb8dcd1c494b0339067ca13f5bfc8ac8a1a43114 commit + bf5b33f40e876afe41fd486ff5d3eb182dfaf046 blob - e007d4345d0e2975492b7aa7aec39768fbde46e8 blob + eda6299eff5213af93e572d7143665cc0db0d7eb --- telescope.c +++ telescope.c @@ -970,16 +970,14 @@ load_url(struct tab *tab, const char *url, const char if (operating && lazy) { tab->flags ^= TAB_LAZY; lazy = 0; - } + } else if (tab->hist_cur != NULL) + get_scroll_position(tab, &tab->hist_cur->line_off, + &tab->hist_cur->current_off); if (!nohist && (!lazy || tab->hist_cur == NULL)) { - if (tab->hist_cur != NULL) { - get_scroll_position(tab, &tab->hist_cur->line_off, - &tab->hist_cur->current_off); - + if (tab->hist_cur != NULL) hist_clear_forward(&tab->hist, TAILQ_NEXT(tab->hist_cur, entries)); - } if ((tab->hist_cur = calloc(1, sizeof(*tab->hist_cur))) == NULL) {