aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msgview/close.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/msgview/close.go')
-rw-r--r--commands/msgview/close.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/commands/msgview/close.go b/commands/msgview/close.go
new file mode 100644
index 00000000..404bb1c1
--- /dev/null
+++ b/commands/msgview/close.go
@@ -0,0 +1,21 @@
+package msgview
+
+import (
+ "errors"
+
+ "git.sr.ht/~sircmpwn/aerc2/widgets"
+)
+
+func init() {
+ register("close", CommandClose)
+}
+
+func CommandClose(aerc *widgets.Aerc, args []string) error {
+ if len(args) != 1 {
+ return errors.New("Usage: close")
+ }
+ mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
+ aerc.RemoveTab(mv)
+ return nil
+}
+