summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-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)
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93