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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: tog: key map to switch split mode
To:
Mark Jamsek <mark@jamsek.com>
Cc:
Omar Polo <op@omarpolo.com>, gameoftrees@openbsd.org
Date:
Fri, 8 Jul 2022 18:05:00 +0200

Download raw body.

Thread
On Sat, Jul 09, 2022 at 01:13:58AM +1000, Mark Jamsek wrote:
> On 22-07-08 10:32am, Stefan Sperling wrote:
> > On Thu, Jul 07, 2022 at 04:03:23PM +0200, Omar Polo wrote:
> > > Mark Jamsek <mark@jamsek.com> wrote:
> > > > Thanks, op! This fixes the problem for me.
> > > 
> > > Yep, this works perfectly!  ok for me.  Thanks!
> > 
> > Why switch on hsplits only while we are already in vpslit mode?
> > Wouldn't it make more sense to apply 'S' regardless of the currently
> > visible split configuration? I would expect it to behave like this:
> > 
> > $ env | grep TOG
> > TOG_COLORS=1
> > $ tog 
> > press S
> > press Enter
> > diff view opens in hsplit in 80x24 terminal
> > 
> > Such that 'S' always toggles between vsplit and hsplit, and hsplit is
> > always applied regardless of terminal size, and vsplit is only applied
> > under consideration of terminal size.
> > 
> > Does this suggested behaviour cause a problem I am not seeing?
> 
> I think this makes more sense and am not sure why I didn't think of this
> to begin with :)
> 
> The below diff seems to implement the behaviour you suggest.

More or less, though I would expect that in 80x24, an open hsplit view
would move into vsplit mode (and thus into the background) when I type
'S'. With your patch, I can open tog and switch from vsplit to hsplit by
typing 'S', but then I cannot switch back to vsplit by typing 'S' again.

Basically my idea is that 'S' switches from hsplit mode into vsplit mode,
and vice versa, and everything gets redrawn according to the rules of
the newly chosen mode.