From f0a0c5aa733fa66958c113465bfc5fdd3d7cc9f0 Mon Sep 17 00:00:00 2001 From: Aditya Srivastava Date: Sun, 11 Aug 2019 20:42:49 -0700 Subject: add close command at global level --- commands/compose/abort.go | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 commands/compose/abort.go (limited to 'commands/compose') diff --git a/commands/compose/abort.go b/commands/compose/abort.go deleted file mode 100644 index 4c121d7..0000000 --- a/commands/compose/abort.go +++ /dev/null @@ -1,33 +0,0 @@ -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 -} -- cgit 1.4.1-2-gfad0