From 3650b72ca64b9fb6a7e7b058ad6ef67894c2866d Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Sun, 4 Aug 2019 16:05:06 +0200 Subject: Implement next-folder using NextPrev with amount This fixes ~sircmpwn/aerc2#182 https://todo.sr.ht/~sircmpwn/aerc2/182 --- commands/account/next-folder.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'commands/account/next-folder.go') diff --git a/commands/account/next-folder.go b/commands/account/next-folder.go index 414e6063..537a3512 100644 --- a/commands/account/next-folder.go +++ b/commands/account/next-folder.go @@ -40,12 +40,10 @@ func (_ NextPrevFolder) Execute(aerc *widgets.Aerc, args []string) error { if acct == nil { return errors.New("No account selected") } - for ; n > 0; n-- { - if args[0] == "prev-folder" { - acct.Directories().Prev() - } else { - acct.Directories().Next() - } + if args[0] == "prev-folder" { + acct.Directories().NextPrev(-n) + } else { + acct.Directories().NextPrev(n) } return nil } -- cgit