aboutsummaryrefslogtreecommitdiffstats
path: root/commands/move-tab.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/move-tab.go')
-rw-r--r--commands/move-tab.go15
1 files changed, 4 insertions, 11 deletions
diff --git a/commands/move-tab.go b/commands/move-tab.go
index 4151bd74..8648ed3d 100644
--- a/commands/move-tab.go
+++ b/commands/move-tab.go
@@ -34,18 +34,11 @@ func (MoveTab) Execute(aerc *widgets.Aerc, args []string) error {
return fmt.Errorf("failed to parse index argument: %v", err)
}
- i := aerc.SelectedTabIndex()
- l := aerc.NumTabs()
-
- if strings.HasPrefix(joinedArgs, "+") {
- i = (i + n) % l
- } else if strings.HasPrefix(joinedArgs, "-") {
- i = (((i + n) % l) + l) % l
- } else {
- i = n
+ var relative bool
+ if strings.HasPrefix(joinedArgs, "+") || strings.HasPrefix(joinedArgs, "-") {
+ relative = true
}
-
- aerc.MoveTab(i)
+ aerc.MoveTab(n, relative)
return nil
}