about summary refs log tree commit diff stats
path: root/commands/msgview/close.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-30 21:45:41 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-30 21:45:41 -0400
commit5d0402aeea1dcc69adb46227ab1cd73b5e768880 (patch)
treefeac387ac2441d36a8bca272efa182884c11f05c /commands/msgview/close.go
parent04d9ab3ce6b8161ef7bc0ec4e5011f6ceadb73b6 (diff)
downloadaerc-5d0402aeea1dcc69adb46227ab1cd73b5e768880.tar.gz
Add message view commands, :close
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 0000000..404bb1c
--- /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
+}
+