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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: tog: add horizontal scroll to tree view (+ minor refactor)
To:
Mark Jamsek <mark@jamsek.com>
Cc:
Game of Trees <gameoftrees@openbsd.org>
Date:
Wed, 1 Feb 2023 13:47:21 +0100

Download raw body.

Thread
On Wed, Feb 01, 2023 at 10:40:44PM +1100, Mark Jamsek wrote:
> As per discussion with op in the previous thread adding hscroll to ref
> view, add hscroll to the tree view too. With this, all views now support
> sideways scrolling :)
> 
> While here, remove some copypasta with a new subroutine for hscroll
> input.
> 
> The new routine introduces a small change in behaviour for the blame,
> diff, and help views such that the rightmost position now centers the
> end of the longest line on the screen. Previously, for these three views
> only, we would continue scrolling till the end of the longest line
> finished about one-third into the view.
> 
> I don't think it matters enough to add another int parameter to the new
> horizontal_scroll_input() routine just to make the rightmost position
> dependent on the view. In fact, it's probably better to keep it
> consistent across all views. But I'm happy either way if you think we
> should.
> 
> tog(1) has been updated by moving the relevant keymaps to global space;
> runtime help was already like this.
> 
> I haven't committed the ref view hscroll change yet but this diff
> applies on top of that one.

I like this a lot, as it makes tog a bit more userfriendly.  ok stsp