summary refs log tree commit diff stats
path: root/widgets/aerc.go
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2019-07-19 18:12:57 +0100
committerDrew DeVault <sir@cmpwn.com>2019-07-23 10:27:59 -0400
commite42b95a617399b2736df96ae6469309e6b306d71 (patch)
tree65bd6f78faa0607a3d73a35b7c59a713472adbea /widgets/aerc.go
parentd526786c9358bc92a5ffc3233e0ba4491aff07ba (diff)
downloadaerc-e42b95a617399b2736df96ae6469309e6b306d71.tar.gz
Add change tab command
This command allows the user to change tab by giving the tab name. This
can be tab completed too. The previous tab is stored in the tabs module
so that when a new tab is created it is still possible to go to the
previous one.

Normal invocation is :ct folder
Previous tab is :ct -
Diffstat (limited to 'widgets/aerc.go')
-rw-r--r--widgets/aerc.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 14cf3c4..079d442 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -252,6 +252,28 @@ func (aerc *Aerc) PrevTab() {
 	aerc.tabs.Select(next)
 }
 
+func (aerc *Aerc) SelectTab(name string) bool {
+	for i, tab := range aerc.tabs.Tabs {
+		if tab.Name == name {
+			aerc.tabs.Select(i)
+			return true
+		}
+	}
+	return false
+}
+
+func (aerc *Aerc) TabNames() []string {
+	var names []string
+	for _, tab := range aerc.tabs.Tabs {
+		names = append(names, tab.Name)
+	}
+	return names
+}
+
+func (aerc *Aerc) SelectPreviousTab() bool {
+	return aerc.tabs.SelectPrevious()
+}
+
 // TODO: Use per-account status lines, but a global ex line
 func (aerc *Aerc) SetStatus(status string) *StatusMessage {
 	return aerc.statusline.Set(status)
idgets/pager.py?h=v1.5.0&id=a78cfb7eee02d27f03b5355d9e42a6ba9522d430'>a78cfb7e ^
506fbaa3 ^
f257e476 ^


45076ed4 ^



6613bf41 ^
06aefcf5 ^
f257e476 ^
06aefcf5 ^
f257e476 ^
06aefcf5 ^
a78cfb7e ^
06aefcf5 ^
f257e476 ^
06aefcf5 ^

a78cfb7e ^
f5596d88 ^
06aefcf5 ^
45076ed4 ^
ea87d005 ^
06aefcf5 ^


ea87d005 ^
33cb688a ^

ea87d005 ^
f257e476 ^
45076ed4 ^















a78cfb7e ^
45076ed4 ^
ea87d005 ^
a78cfb7e ^


43e0f44a ^
98761094 ^









a78cfb7e ^
a406a33d ^





6613bf41 ^
a406a33d ^

292b4476 ^
a406a33d ^





a406a33d ^


292b4476 ^
06aefcf5 ^

524cbdda ^
41df56be ^
ea87d005 ^
5715beca ^
f257e476 ^


ee7b001d ^
5715beca ^

43e0f44a ^
ee7b001d ^

5715beca ^
1a8d64f1 ^
f257e476 ^
ee7b001d ^

f257e476 ^






32944f05 ^
f257e476 ^
5715beca ^


f257e476 ^

06aefcf5 ^
b4cb1f7d ^

b3125849 ^

d6e2900a ^
b4cb1f7d ^

f257e476 ^
a406a33d ^
f257e476 ^



811f5bb8 ^

6613bf41 ^

811f5bb8 ^


7defcc26 ^
811f5bb8 ^
f257e476 ^

ea87d005 ^
f257e476 ^






43e0f44a ^
9b05f8d7 ^
43e0f44a ^


f257e476 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184