A pager is spawned every time an email is viewed but not killed off when quitting the msgviewer, thus leading to process leakage. This patch fixes this by adding a Close method to the msgview widget, which is called in the close command. Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
32 lines
503 B
Go
32 lines
503 B
Go
package msgview
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"git.sr.ht/~sircmpwn/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
|
|
}
|