0d645bcebd
I'm not sure what are the implications but it seems required. Link: https://github.com/golang/go/issues/20883 Signed-off-by: Robin Jarry <robin@jarry.cc>
31 lines
501 B
Go
31 lines
501 B
Go
package msgview
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"git.sr.ht/~rjarry/aerc/widgets"
|
|
)
|
|
|
|
type Close struct{}
|
|
|
|
func init() {
|
|
register(Close{})
|
|
}
|
|
|
|
func (Close) Aliases() []string {
|
|
return []string{"close"}
|
|
}
|
|
|
|
func (Close) Complete(aerc *widgets.Aerc, args []string) []string {
|
|
return nil
|
|
}
|
|
|
|
func (Close) Execute(aerc *widgets.Aerc, args []string) error {
|
|
if len(args) != 1 {
|
|
return errors.New("Usage: close")
|
|
}
|
|
mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
|
|
mv.Close()
|
|
aerc.RemoveTab(mv)
|
|
return nil
|
|
}
|