aboutsummaryrefslogtreecommitdiffstats
path: root/commands/compose
diff options
context:
space:
mode:
Diffstat (limited to 'commands/compose')
-rw-r--r--commands/compose/abort.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/commands/compose/abort.go b/commands/compose/abort.go
new file mode 100644
index 00000000..4c121d72
--- /dev/null
+++ b/commands/compose/abort.go
@@ -0,0 +1,33 @@
+package compose
+
+import (
+ "errors"
+
+ "git.sr.ht/~sircmpwn/aerc/widgets"
+)
+
+type Abort struct{}
+
+func init() {
+ register(Abort{})
+}
+
+func (_ Abort) Aliases() []string {
+ return []string{"abort"}
+}
+
+func (_ Abort) Complete(aerc *widgets.Aerc, args []string) []string {
+ return nil
+}
+
+func (_ Abort) Execute(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
+}