"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: tog: fix resize failure to populate log view commits
To:
gameoftrees@openbsd.org
Date:
Mon, 18 Jul 2022 23:12:27 +1000

Download raw body.

Thread
On 22-07-18 02:49pm, Stefan Sperling wrote:
> On Mon, Jul 18, 2022 at 10:34:27PM +1000, Mark Jamsek wrote:
> > If resizing a log view while on the _last_ loaded commit on the bottom
> > edge of the screen, some of the new lines are not populated.
> > 
> > repro:
> > $ tog  # 80x24
> > 23j  # move down to the last commit
> > *increase terminal height to ~30 lines then reduce back to 80x24*
> > ~5j  # move down to the _last_ commit
> > *increase terminal height to ~33 lines*
> > 
> > Most of the new lines are empty.
> > 
> > We call request_log_commits() from view_resize()--but only when the view
> > has a child view. The fix simply moves this check, so that we always
> > call request_log_commits() if the terminal height has been increased,
> > irrespective of whether a child view exists.
> 
> I only have a concern about style consistency:
> 
> Could we add a resize function pointer to struct tog_view and call this
> (if not NULL) instead of checking the view type and manipulating diff
> view state in view_resize() directly?
> 
> The code would then move into a new resize_diff_view() function.

Sure! That would be better. Do you mean just the logic for requesting
commits in the event the terminal height is increased into
a resize_log_view() routine to be called from view_resize()?

-- 
Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68