aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2023-07-26 11:18:24 +0200
committerRobin Jarry <robin@jarry.cc>2023-08-03 22:31:34 +0200
commitd29c9d1a2ff82234ad1810abc6a57199340e7fd5 (patch)
tree5d87ff8313f12c288bc41466453b0ed139a20c8b /widgets
parent0e09c05937913a938bc4987db2b6d193ed0501bd (diff)
downloadaerc-d29c9d1a2ff82234ad1810abc6a57199340e7fd5.tar.gz
templates: attach directly from templates
Attach a file from templates. Add a split template function. {{- .Attach "LICENSE" -}} or {{range (exec "find ./doc -type f -name *.scd" "" | split "\n") -}} {{with . }} {{- $.Attach . -}} {{- end}} {{- end}} Fixes: https://todo.sr.ht/~rjarry/aerc/109 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r--widgets/compose.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index 281a35cc..0aac8705 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -104,6 +104,7 @@ func NewComposer(
data.SetAccount(acct.acct)
data.SetFolder(acct.Directories().SelectedDirectory())
data.SetHeaders(h, orig)
+ data.SetComposer(c)
if err := c.addTemplate(template, data.Data(), body); err != nil {
return nil, err
}
@@ -112,7 +113,6 @@ func NewComposer(
} else if err != nil {
return nil, err
}
-
if err := c.setupFor(acct); err != nil {
return nil, err
}