aboutsummaryrefslogblamecommitdiffstats
path: root/commands/msgview/close.go
blob: e388f65d2e7b91715351328db40fe8318acf1bb5 (plain) (tree)
1
2
3
4
5
6




                
                                          














                                                            
package msgview

import (
	"errors"

	"git.sr.ht/~sircmpwn/aerc/widgets"
)

func init() {
	register("close", CommandClose)
}

func CommandClose(aerc *widgets.Aerc, args []string) error {
	if len(args) != 1 {
		return errors.New("Usage: close")
	}
	mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
	aerc.RemoveTab(mv)
	return nil
}