diff options
Diffstat (limited to 'commands/ct.go')
-rw-r--r-- | commands/ct.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/commands/ct.go b/commands/ct.go index 092d9739..3bd3428e 100644 --- a/commands/ct.go +++ b/commands/ct.go @@ -40,15 +40,16 @@ func (ChangeTab) Execute(aerc *widgets.Aerc, args []string) error { } else { n, err := strconv.Atoi(joinedArgs) if err == nil { - if strings.HasPrefix(joinedArgs, "+") { + switch { + case strings.HasPrefix(joinedArgs, "+"): for ; n > 0; n-- { aerc.NextTab() } - } else if strings.HasPrefix(joinedArgs, "-") { + case strings.HasPrefix(joinedArgs, "-"): for ; n < 0; n++ { aerc.PrevTab() } - } else { + default: ok := aerc.SelectTabIndex(n) if !ok { return errors.New( |