aboutsummaryrefslogtreecommitdiffstats
path: root/commands/account/split.go
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-10-20 11:03:53 -0500
committerRobin Jarry <robin@jarry.cc>2022-10-20 22:17:18 +0200
commitedd48c998161f7d0951f80885180d7b8e356e97e (patch)
tree379917a7739d1ff5b3807191e0cbafeb4c102b49 /commands/account/split.go
parent0cc56781dcf49ef9fd5eb580d433d01f892ab276 (diff)
downloadaerc-edd48c998161f7d0951f80885180d7b8e356e97e.tar.gz
split: clamp minimum split size to 1
The split command allows delta size changes, which triggers a condition where the split can overflow into the dirlist. Clamp the minimum size of a split or vsplit to "1" to prevent the view from overflowing, or completely covering the message list. A split of 0 will still clear the split. Reported-by: Koni Marti <koni.marti@gmail.com> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/account/split.go')
-rw-r--r--commands/account/split.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/commands/account/split.go b/commands/account/split.go
index 64ca4f9e..72292c43 100644
--- a/commands/account/split.go
+++ b/commands/account/split.go
@@ -57,6 +57,10 @@ func (Split) Execute(aerc *widgets.Aerc, args []string) error {
// toggling the split
n = 0
}
+ if n < 0 {
+ // Don't allow split to go negative
+ n = 1
+ }
if args[0] == "split" {
return acct.Split(n)
}