"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:
Omar Polo <op@omarpolo.com>
Cc:
Mark Jamsek <mark@jamsek.com>, gameoftrees@openbsd.org
Date:
Fri, 8 Jul 2022 10:32:13 +0200

Download raw body.

Thread
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!

Is the current behaviour of this patch really what we want?

By default, tog only opens a hsplit view if a vsplit view was opened
first, and if tog was then switched into hsplit mode with the S key.

Starting in a 80x24 terminal:

$ env | grep TOG
TOG_COLORS=1
$ tog 
press Enter
diff view opens fullscreen in 80x24 terminal
resize terminal until vsplit appears
press S
resize back to 80x24
now diff view opens in hsplit in 80x24 terminal

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?