aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--commands/account/split.go8
-rw-r--r--doc/aerc.1.scd6
3 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7d505bcf..3a42fa52 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `pgp-provider` now defaults to `auto`. It will use the system `gpg` unless
the internal keyring exists and contains at least one key.
+- calling `:split` or `:vsplit` without specifying a size, now attempts to use
+ the terminal size to determine a useful split-size.
### Fixed
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
diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd
index ad18c984..949eb6ee 100644
--- a/doc/aerc.1.scd
+++ b/doc/aerc.1.scd
@@ -382,7 +382,8 @@ message list, the message in the message viewer, etc).
calling *:split* _0_, or just *:split*. The split can be toggled by
calling split with the same (absolute) size repeatedly. For example,
*:split* _10_ will create a split. Calling *:split* _10_ again will
- remove the split. Also see *:vsplit*.
+ remove the split. If not specified, _<n>_ is set to an estimation based
+ on the user's terminal. Also see *:vsplit*.
*:sort* [[*-r*] _<criterion>_]...
Sorts the message list by the given criteria. *-r* sorts the
@@ -426,7 +427,8 @@ message list, the message in the message viewer, etc).
calling *:vsplit* _0_, or just *:vsplit*. The split can be toggled by
calling split with the same (absolute) size repeatedly. For example,
*:vsplit* _10_ will create a split. Calling *:vsplit* _10_ again will
- remove the split. Also see *:split*.
+ remove the split. If not specified, _<n>_ is set to an estimation based
+ on the user's terminal. Also see *:split*.
## MESSAGE VIEW COMMANDS