aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-03-04 00:15:57 +0100
committerRobin Jarry <robin@jarry.cc>2023-03-08 00:43:00 +0100
commit573b3266afcf6dc52c82ffa238f5d9b82ee11cf7 (patch)
treea8a3031183f3d444957bd64ab0627fd879bac62e
parent66c532f859dd477ce57e222107c6b371e66064b8 (diff)
downloadaerc-573b3266afcf6dc52c82ffa238f5d9b82ee11cf7.tar.gz
aerc-573b3266afcf6dc52c82ffa238f5d9b82ee11cf7.zip
templates: reverse args order for .Style
In preparation for .StyleMatch put the content first, followed by the style name. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
-rw-r--r--doc/aerc-templates.7.scd2
-rw-r--r--lib/state/templates.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/doc/aerc-templates.7.scd b/doc/aerc-templates.7.scd
index 8a2a3381..7d77cd0b 100644
--- a/doc/aerc-templates.7.scd
+++ b/doc/aerc-templates.7.scd
@@ -374,7 +374,7 @@ aerc provides the following additional functions:
Apply a user-defined style (see *aerc-stylesets*(7)) to a string.
```
- {{.Style "red" .Account}}
+ {{.Style .Account "red"}}
```
*version*
diff --git a/lib/state/templates.go b/lib/state/templates.go
index b5a5ee05..1e8bad00 100644
--- a/lib/state/templates.go
+++ b/lib/state/templates.go
@@ -467,7 +467,7 @@ func (d *TemplateData) PendingKeys() string {
return config.FormatKeyStrokes(d.pendingKeys)
}
-func (d *TemplateData) Style(name string, content string) string {
+func (d *TemplateData) Style(content, name string) string {
cfg := config.Ui.ForAccount(d.Account())
style := cfg.GetUserStyle(name)
return parse.ApplyStyle(style, content)