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

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: tog: horizontal split
To:
gameoftrees@openbsd.org
Date:
Thu, 30 Jun 2022 01:06:24 +1000

Download raw body.

Thread
On 22-06-29 04:53pm, Stefan Sperling wrote:
> On Thu, Jun 30, 2022 at 12:17:59AM +1000, Mark Jamsek wrote:
> > On 22-06-26 11:08pm, Mark Jamsek wrote:
> > > The below diff adds support for horizontal splits in tog.
> > > 
> > > There are a couple bugs that need squishing:
> > >   - resizing with an open hsplit sometimes kills the border and there
> > >     seems to be an OB1 that makes the top split misrender a line
> > >   - the double-width bug in the log view has returned where we overwrite
> > >     the vertical border by one column; strangely enough if you open the
> > >     commit in ja.git in a vsplit then press F, tab, tab, F, it renders
> > >     correctly
> > > 
> > 
> > Thanks to Omar, the above bugs (plus the double-width char bug in vsplit
> > that the diff broke) have been squished.
> > 
> > In short, the main problem was that we were trying to account for the
> > border when initialising the split, which left us a line short when
> > later reszing because we'd deducted the line. The fix was to account for
> > the border when scrolling rather than try to account for it in sizing.
> > 
> > This also makes the diff a lot cleaner imo. op's and stsp's suggestions
> > have been applied and the split config removed. The scale is set with
> > HSPLIT_SCALE. To test hsplit: `$ TOG_VIEW_SPLIT_MODE=h tog`
> > 
> > Also in the diff, echo count prefix to the bottom left of the _terminal_
> > screen irrespective of the split or active window (rather than the
> > bottom left of the top horizontal or right vertical split.  I haven't
> > changed the location of the search "/" prompt except for in hsplits;
> > I thought I'd see what the consensus is first. At present, we draw the
> > search prompt in the bottom left of the active view when in a vsplit. So
> > we can either continue this behaviour with hsplits, or always echo to
> > the absolute bottom left of the screen. I wanted to get a feel for what
> > they both look like, but I don't feel strongly one way or the other.
> > I suppose it feels a little surprsing to have it in different locations
> > but that's subjective.
> 
> I think displaying the counter at the bottom of the active view makes
> more sense than always using the last line of the terminal. But such
> behaviour can always be tweaked later. And horizontal split is not yet
> enabled by default anyway.

In testing, it took me by surprise at first when the counter was echoing
a third from the top of the screen, which is why I wanted to see how it
looked at the bottom. And I agree that it makes more sense in vsplits to
echo in the active view as I sometimes have wide terms and it's a long
way to the left to refocus. Split orientation notwithstanding, behaviour
should be consistent so, yes, I think sticking it to the active view
would make the most sense. It might take a bit to get used to that in
hsplits though.

> This patch is a great start. I would be fine with this going in as it is,
> with further tweaks to be expected on top later. For example, horizontal
> splitting should work via tog log -> tree -> blame just like it does
> for tog tree -> blame. That is the most urgent usability issue I can see.

Thanks, Stefan!

And, yes, there's still a lot more work I have planned here.
Specifically, expand hsplit support to all parent/child views, and
keymaps for split type and size--assuming this is ok?

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