aboutsummaryrefslogtreecommitdiffstats
path: root/commands/eml.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/eml.go')
-rw-r--r--commands/eml.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/commands/eml.go b/commands/eml.go
index 45dd4f25..864145ce 100644
--- a/commands/eml.go
+++ b/commands/eml.go
@@ -1,6 +1,7 @@
package commands
import (
+ "bytes"
"fmt"
"io"
"os"
@@ -17,7 +18,7 @@ func init() {
}
func (Eml) Aliases() []string {
- return []string{"eml"}
+ return []string{"eml", "preview"}
}
func (Eml) Complete(aerc *widgets.Aerc, args []string) []string {
@@ -54,6 +55,16 @@ func (Eml) Execute(aerc *widgets.Aerc, args []string) error {
case *widgets.MessageViewer:
part := tab.SelectedMessagePart()
tab.MessageView().FetchBodyPart(part.Index, showEml)
+ case *widgets.Composer:
+ var buf bytes.Buffer
+ h, err := tab.PrepareHeader()
+ if err != nil {
+ return err
+ }
+ if err := tab.WriteMessage(h, &buf); err != nil {
+ return err
+ }
+ showEml(&buf)
default:
return fmt.Errorf("unsupported operation")
}