aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-09-06 07:33:21 +0200
committerRobin Jarry <robin@jarry.cc>2023-01-06 22:56:47 +0100
commit535300cfdbfc6e72fe9717c409fa64f072a1c581 (patch)
treedadcb1c1d88406134e532ab0f6cd87e54ff659d7 /lib
parent012be0192c88f4fcfd5ed559edff4ca7366eb351 (diff)
downloadaerc-535300cfdbfc6e72fe9717c409fa64f072a1c581.tar.gz
config: add columns based index format
The index-format option comes from mutt and is neither user friendly, nor intuitive. Introduce a new way of configuring the message list contents. Replace index-format with multiple settings to make everything more intuitive. Reuse the table widget added in the previous commit. index-columns Comma-separated list of column names followed by optional alignment and width specifiers. column-separator String separator between columns. column-$name One setting for every name defined in index-columns. This supports golang text/template syntax and allows access to the same message information than before and much more. When index-format is still defined in aerc.conf (which will most likely happen when users will update after this patch), convert it to the new index-columns + column-$name and column-separator system and a warning is displayed on startup so that users are aware that they need to update their config. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/templates/data.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/templates/data.go b/lib/templates/data.go
index dab698d5..cb69d8fe 100644
--- a/lib/templates/data.go
+++ b/lib/templates/data.go
@@ -20,6 +20,10 @@ type TemplateData struct {
marked bool
msgNum int
+ // message list threading
+ ThreadSameSubject bool
+ ThreadPrefix string
+
// account config
myAddresses map[string]bool
account string
@@ -215,7 +219,10 @@ func (d *TemplateData) Subject() string {
case d.headers != nil:
subject = d.Header("subject")
}
- return subject
+ if d.ThreadSameSubject {
+ subject = ""
+ }
+ return d.ThreadPrefix + subject
}
func (d *TemplateData) SubjectBase() string {