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

Mark Jamsek <mark@jamsek.com>
Re: tog: call resize_log_view() when toggling fullscreen from child diff view
Game of Trees <gameoftrees@openbsd.org>
Mon, 24 Apr 2023 19:48:29 +1000

Download raw body.

On 23-04-23 11:35PM, Stefan Sperling wrote:
> On Sun, Apr 23, 2023 at 10:46:35PM +1000, Mark Jamsek wrote:
> > When toggling fullscreen, we check if the view has a resize() function
> > pointer to call. We do this for the log view to ensure enough commits
> > are loaded to populate the view when going from a horizontal split to
> > fullscreen, for example.
> > 
> > However, we neglected to do this when toggling fullscreen from a child
> > view if the parent view has the resize() routine; for example, when in
> > a diff view opened from the log. The first of the two below diffs adds
> > this check to call view->resize(). This fixes a bug that prevents
> > scrolling the log from the diff view with the J keymap if on the last
> > loaded commit. The second diff adds a test for this case.
> It is very nice to see test cases being added for corner cases
> like this! ok

Yes, I'm hoping that as coverage grows it will help mitigate breaks when
making changes. Next holidays I'm going to transfer my old list of
manual tog operations I would run to test cases because I want to
refactor some bits, but not until we have tests for the bits I'm
refactoring. Having that coverage will increase confidence that it
doesn't break anything :)

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