about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCole Helbling <cole.e.helbling@gmail.com>2019-05-14 13:20:57 -0700
committerDrew DeVault <sir@cmpwn.com>2019-05-14 16:21:45 -0400
commitb0b3287bbdadad47757f3543a6560494af9175a8 (patch)
tree0c1ce33fb14bf31bd80acbece44b8a5d3378d465
parent2c486cb7f52ac5dd88f7445ca79726639e4a0084 (diff)
downloadaerc-b0b3287bbdadad47757f3543a6560494af9175a8.tar.gz
Implement abort command
This allows the user to close the compose tab without sending their
current composition.
-rw-r--r--commands/compose/abort.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/commands/compose/abort.go b/commands/compose/abort.go
new file mode 100644
index 0000000..1cd297e
--- /dev/null
+++ b/commands/compose/abort.go
@@ -0,0 +1,23 @@
+package compose
+
+import (
+	"errors"
+
+	"git.sr.ht/~sircmpwn/aerc2/widgets"
+)
+
+func init() {
+	register("abort", CommandAbort)
+}
+
+func CommandAbort(aerc *widgets.Aerc, args []string) error {
+	if len(args) != 1 {
+		return errors.New("Usage: abort")
+	}
+	composer, _ := aerc.SelectedTab().(*widgets.Composer)
+
+	aerc.RemoveTab(composer)
+	composer.Close()
+
+	return nil
+}
3c3'>b38d7fff ^
a6d9bd9b ^


e3894819 ^
b38d7fff ^
a6d9bd9b ^



1ae4e0d9 ^
a6d9bd9b ^
31a9d39e ^

a6d9bd9b ^
1ae4e0d9 ^


fbf0536d ^




77d5b5d6 ^
b38d7fff ^
e3894819 ^
1ae4e0d9 ^
fc2046a1 ^
8ebe8ef6 ^
38f0b91a ^
04afb4b0 ^

b38d7fff ^

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