From edd48c998161f7d0951f80885180d7b8e356e97e Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Thu, 20 Oct 2022 11:03:53 -0500 Subject: 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 Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- commands/account/split.go | 4 ++++ 1 file changed, 4 insertions(+) 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) } -- cgit