Debian Codegraph @

commands/compose/abort.go

raw
1 package compose
2
3 import (
4 "git.sr.ht/~rjarry/aerc/app"
5 "git.sr.ht/~rjarry/aerc/commands"
6 )
7
8 type Abort struct{}
9
10 func init() {
11 commands.Register(Abort{})
12 }
13
14 func (Abort) Description() string {
15 return "Close the composer without sending."
16 }
17
18 func (Abort) Context() commands.CommandContext {
19 return commands.COMPOSE_EDIT | commands.COMPOSE_REVIEW
20 }
21
22 func (Abort) Aliases() []string {
23 return []string{"abort"}
24 }
25
26 func (Abort) Execute(args []string) error {
27 composer, _ := app.SelectedTabContent().(*app.Composer)
28 app.RemoveTab(composer, true)
29 return nil
30 }