summary refs log tree commit diff stats
path: root/widgets/aerc.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-17 16:24:17 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-17 16:24:17 -0400
commit14cb8cb51f4a1dfca2486d154e2206b19f9401a7 (patch)
treeadde7fa11e632df86b191610feb296eb7de39980 /widgets/aerc.go
parent589db742cb2af4b29607ceba62ceca38ec982f62 (diff)
downloadaerc-14cb8cb51f4a1dfca2486d154e2206b19f9401a7.tar.gz
Implement :next-tab, :prev-tab
Diffstat (limited to 'widgets/aerc.go')
-rw-r--r--widgets/aerc.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 5841876..b94d03d 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -146,6 +146,22 @@ func (aerc *Aerc) NewTab(drawable ui.Drawable, name string) *ui.Tab {
 	return tab
 }
 
+func (aerc *Aerc) NextTab() {
+	next := aerc.tabs.Selected + 1
+	if next >= len(aerc.tabs.Tabs) {
+		next = 0
+	}
+	aerc.tabs.Select(next)
+}
+
+func (aerc *Aerc) PrevTab() {
+	next := aerc.tabs.Selected - 1
+	if next < 0 {
+		next = len(aerc.tabs.Tabs) - 1
+	}
+	aerc.tabs.Select(next)
+}
+
 // TODO: Use per-account status lines, but a global ex line
 func (aerc *Aerc) SetStatus(status string) *StatusMessage {
 	return aerc.statusline.Set(status)