diff options
author | Bence Ferdinandy <bence@ferdinandy.com> | 2023-11-24 21:28:12 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-11-24 22:45:03 +0100 |
commit | 8ee61777ada29432783e18a7634ab1150a631987 (patch) | |
tree | b66e9ea50282c4cbb05fb680e101694d3b09c8fd /lib/state/templates.go | |
parent | eda71c55d4ccd3b43c2f108de8f9ea9f8382db36 (diff) | |
download | aerc-8ee61777ada29432783e18a7634ab1150a631987.tar.gz |
templates: display "(no subject)" when subject is empty
An empty subject, especially in a thread makes it for a slightly jarring
layout. Add a new option empty-subject option to UI with "(no subject")
as the default value. If the subject is empty and the current message is
not the same subject as it's parent in a thread make {{.Subject}}
evaluate to this option's value.
Changelog-added: The `{{.Subject}}` template is evaluated to the new
option `[ui].empty-subject` if the subject is empty.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/state/templates.go')
-rw-r--r-- | lib/state/templates.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/state/templates.go b/lib/state/templates.go index e8c50e86..ef84f071 100644 --- a/lib/state/templates.go +++ b/lib/state/templates.go @@ -325,6 +325,8 @@ func (d *templateData) Subject() string { } if d.threadInfo.SameSubject { subject = "" + } else if subject == "" { + subject = config.Ui.EmptySubject } return subject } |