From 577248f5e15d98a9a6522a605acd434059582bfc Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 12 May 2019 00:06:09 -0400 Subject: Add initial compose widget --- commands/account/compose.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 commands/account/compose.go (limited to 'commands/account') diff --git a/commands/account/compose.go b/commands/account/compose.go new file mode 100644 index 00000000..15fc3549 --- /dev/null +++ b/commands/account/compose.go @@ -0,0 +1,28 @@ +package account + +import ( + "errors" + + "github.com/mattn/go-runewidth" + + "git.sr.ht/~sircmpwn/aerc2/widgets" +) + +func init() { + register("compose", Compose) +} + +// TODO: Accept arguments for default headers, message body +func Compose(aerc *widgets.Aerc, args []string) error { + if len(args) != 1 { + return errors.New("Usage: compose") + } + // TODO: Pass along the sender info + composer := widgets.NewComposer() + // TODO: Change tab name when message subject changes + aerc.NewTab(composer, runewidth.Truncate( + "New email", 32, "…")) + return nil +} + + -- cgit