summary refs log tree commit diff stats
path: root/commands
diff options
context:
space:
mode:
authorJelle Besseling <jelle@pingiun.com>2019-08-04 16:05:06 +0200
committerDrew DeVault <sir@cmpwn.com>2019-08-07 15:02:11 +0900
commit3650b72ca64b9fb6a7e7b058ad6ef67894c2866d (patch)
tree1833f2166b90bf1ef88f1b7415cdd889b7c2bca4 /commands
parent1f6c108c0412a03bfadd01ac81607e76ecbcd2d7 (diff)
downloadaerc-3650b72ca64b9fb6a7e7b058ad6ef67894c2866d.tar.gz
Implement next-folder using NextPrev with amount
This fixes ~sircmpwn/aerc2#182

https://todo.sr.ht/~sircmpwn/aerc2/182
Diffstat (limited to 'commands')
-rw-r--r--commands/account/next-folder.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/commands/account/next-folder.go b/commands/account/next-folder.go
index 414e606..537a351 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
 }
0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
[codespell]
skip = libtool,./autom4te.cache/*,*.html,./build-aux/*,./.git/*,aclocal*,./m4/*,./config.status,./configure,./config.log,todo