2022-05-05 19:53:16 +02:00
|
|
|
package compose
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"git.sr.ht/~rjarry/aerc/widgets"
|
|
|
|
)
|
|
|
|
|
|
|
|
type AttachKey struct{}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
register(AttachKey{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (AttachKey) Aliases() []string {
|
|
|
|
return []string{"attach-key"}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (AttachKey) Complete(aerc *widgets.Aerc, args []string) []string {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (AttachKey) Execute(aerc *widgets.Aerc, args []string) error {
|
|
|
|
if len(args) != 1 {
|
|
|
|
return errors.New("Usage: attach-key")
|
|
|
|
}
|
|
|
|
|
2022-07-18 12:54:55 +02:00
|
|
|
composer, _ := aerc.SelectedTabContent().(*widgets.Composer)
|
2022-05-05 19:53:16 +02:00
|
|
|
|
2022-06-28 23:42:07 +02:00
|
|
|
return composer.SetAttachKey(!composer.AttachKey())
|
2022-05-05 19:53:16 +02:00
|
|
|
}
|