diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-12-17 22:28:58 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-12-19 11:57:44 +0100 |
commit | c6587e592d08fc47117b7448491204c775783e4b (patch) | |
tree | 917395b8ae223e5cfcebfc6ec643192eb5c5c3f9 /commands | |
parent | 723ab8d9f373d35f629e1b3c9ec68fa8983aafd4 (diff) | |
download | aerc-c6587e592d08fc47117b7448491204c775783e4b.tar.gz |
split: use a sensible default width
Guessing a width/height with v?split is rather bothersome, using a
sensible value based on the user's terminal would be preferable. This
also prevents confusion when running :v?split without a number seemingly
does not open a split.
Initialize width as half the width of the message list and height as an
eight of the message list.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/account/split.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/commands/account/split.go b/commands/account/split.go index 080d0b1b..daf1f0f0 100644 --- a/commands/account/split.go +++ b/commands/account/split.go @@ -31,6 +31,14 @@ func (Split) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("No account selected") } n := 0 + if acct.SplitSize() == 0 { + if args[0] == "split" { + n = aerc.SelectedAccount().Messages().Height() / 4 + } else { + n = aerc.SelectedAccount().Messages().Width() / 2 + } + } + var err error if len(args) > 1 { delta := false |