commands/close.go
raw| 1 | package commands |
| 2 | |
| 3 | import ( |
| 4 | "git.sr.ht/~rjarry/aerc/app" |
| 5 | ) |
| 6 | |
| 7 | type Close struct{} |
| 8 | |
| 9 | func init() { |
| 10 | Register(Close{}) |
| 11 | } |
| 12 | |
| 13 | func (Close) Description() string { |
| 14 | return "Close the focused tab." |
| 15 | } |
| 16 | |
| 17 | func (Close) Context() CommandContext { |
| 18 | return MESSAGE_VIEWER | TERMINAL |
| 19 | } |
| 20 | |
| 21 | func (Close) Aliases() []string { |
| 22 | return []string{"close"} |
| 23 | } |
| 24 | |
| 25 | func (Close) Execute([]string) error { |
| 26 | app.RemoveTab(app.SelectedTabContent(), true) |
| 27 | return nil |
| 28 | } |