Revert "add close command at global level"
This reverts commit f0a0c5aa73
.
This commit is contained in:
parent
f0a0c5aa73
commit
4fc6fee734
6 changed files with 100 additions and 72 deletions
commands/compose
33
commands/compose/abort.go
Normal file
33
commands/compose/abort.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue