From 4fc6fee734e1b88c9aab94e66f5a2f908a86452f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 13 Aug 2019 10:55:50 +0900 Subject: Revert "add close command at global level" This reverts commit f0a0c5aa733fa66958c113465bfc5fdd3d7cc9f0. --- commands/msgview/close.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 commands/msgview/close.go (limited to 'commands/msgview') diff --git a/commands/msgview/close.go b/commands/msgview/close.go new file mode 100644 index 0000000..6a7eb0a --- /dev/null +++ b/commands/msgview/close.go @@ -0,0 +1,30 @@ +package msgview + +import ( + "errors" + + "git.sr.ht/~sircmpwn/aerc/widgets" +) + +type Close struct{} + +func init() { + register(Close{}) +} + +func (_ Close) Aliases() []string { + return []string{"close"} +} + +func (_ Close) Complete(aerc *widgets.Aerc, args []string) []string { + return nil +} + +func (_ Close) Execute(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