Revert "add close command at global level"

This reverts commit f0a0c5aa73.
This commit is contained in:
Drew DeVault 2019-08-13 10:55:50 +09:00
parent f0a0c5aa73
commit 4fc6fee734
6 changed files with 100 additions and 72 deletions
commands/compose

33
commands/compose/abort.go Normal file
View file

@ -0,0 +1,33 @@
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
}