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

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: tog: math fix for fullscreen log view
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 22 Jun 2022 01:24:55 +1000

Download raw body.

Thread
On 22-06-19 06:29pm, Omar Polo wrote:
> thanks to Mark i discovered that it's possible to cycle fullscreen views
> in tog, and playing with his diff I noticed that my math was wrong.
> 
> In draw_commit I assumed that if view->child is not NULL then we have to
> account for the vertical border.  that's not true and cause tog not to
> use the full length drawing the commits when the log view is in
> fullscreen.
> 
> to reproduce open a diff in split screen, then 'f' and tab.  With commit
> message long enough (see for e.g. ja.git) you'll see that the last
> column is empty because we're accounting for a border that we don't
> draw.
> 
> ok?

Yes, this fixes the trim in my tests. Nice find!

> diff d8b5af438b16bcea5568b1d4bfc127567e35e2f6 /home/op/w/got
> blob - b8935d8f4d93a4f03c1d8727adb23a6137741acf
> file + tog/tog.c
> --- tog/tog.c
> +++ tog/tog.c
> @@ -1542,7 +1542,7 @@ draw_commit(struct tog_view *view, struct got_commit_o
>  	if (newline)
>  		*newline = '\0';
>  	limit = avail - col;
> -	if (view->child && limit > 0)
> +	if (view->child && view_is_splitscreen(view->child) && limit > 0)
>  		limit--;	/* for the border */
>  	err = format_line(&wlogmsg, &logmsg_width, &scrollx, logmsg, view->x,
>  	    limit, col, 1);
> 

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