From 5d0402aeea1dcc69adb46227ab1cd73b5e768880 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 30 Mar 2019 21:45:41 -0400 Subject: Add message view commands, :close --- commands/msgview/close.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 commands/msgview/close.go (limited to 'commands/msgview/close.go') 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 +} + -- cgit v1.2.3