aboutsummaryrefslogtreecommitdiffstats
path: root/config/ui.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2023-07-14 20:37:32 +0200
committerRobin Jarry <robin@jarry.cc>2023-07-16 10:13:12 +0200
commitb267de83e38c09d34215e7a33991ae5c111fe649 (patch)
treeadeb2619459228d43475d4efd92324ba82ad4e38 /config/ui.go
parent94b1c778dbe691a75b0d918e9c40cc34f8523768 (diff)
downloadaerc-b267de83e38c09d34215e7a33991ae5c111fe649.tar.gz
templates: add ThreadCount and ThreadFolded
Add the number of threads and a flag to indicated folded threads to the template data. Use {{.ThreadCount}} and {{.ThreadFolded}} in template expression for the message list. column-subject = {{.ThreadPrefix}}{{if .ThreadFolded}}[{{.ThreadCount}}] {{end}}{{.Subject}} Update default configuration accordingly. Signed-off-by: Koni Marti <koni.marti@gmail.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: inwit <inwit@sindominio.net>
Diffstat (limited to 'config/ui.go')
-rw-r--r--config/ui.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/config/ui.go b/config/ui.go
index dfd66224..ff6fbccf 100644
--- a/config/ui.go
+++ b/config/ui.go
@@ -303,7 +303,8 @@ func (*UIConfig) ParseIndexColumns(section *ini.Section, key *ini.Key) ([]*Colum
_, _ = section.NewKey("column-flags", `{{.Flags | join ""}}`)
}
if !section.HasKey("column-subject") {
- _, _ = section.NewKey("column-subject", `{{.ThreadPrefix}}{{.Subject}}`)
+ _, _ = section.NewKey("column-subject",
+ `{{.ThreadPrefix}}{{if .ThreadFolded}}{{printf "{%d}" .ThreadCount}}{{end}}{{.Subject}}`)
}
return ParseColumnDefs(key, section)
}