From 35040bec9962cac3c92039fac85a4068e148b0a0 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Fri, 3 Mar 2023 17:37:05 +0100 Subject: templates: separate thread prefix from subject Extract {{.ThreadPrefix}} from {{.Subject}} so that the prefix can be styled in a different color. Signed-off-by: Robin Jarry Acked-by: Tim Culverhouse --- widgets/msglist.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'widgets/msglist.go') diff --git a/widgets/msglist.go b/widgets/msglist.go index 24f3d3bf..4bf20b09 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -160,11 +160,10 @@ func (ml *MessageList) Draw(ctx *ui.Context) { } baseSubject := threadSubject(store, thread) - data.ThreadSameSubject = baseSubject == lastSubject && - sameParent(thread, prevThread) && - !isParent(thread) - data.ThreadPrefix = threadPrefix(thread, - store.ReverseThreadOrder()) + data.SetThreading( + threadPrefix(thread, store.ReverseThreadOrder()), + baseSubject == lastSubject && sameParent(thread, prevThread) && !isParent(thread), + ) lastSubject = baseSubject prevThread = thread -- cgit