From 9ce4af011c93e2816ce04012f6205b54e0ed1d51 Mon Sep 17 00:00:00 2001 From: inwit Date: Sun, 29 Oct 2023 23:45:55 +0100 Subject: fold: allow for multiple folding levels Extend the :fold/:unfold behaviour to allow for multiple folding levels. Signed-Off-By: inwit Acked-by: Robin Jarry --- worker/notmuch/lib/database.go | 6 +++++- worker/types/thread.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'worker') diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go index 015126c2..b2a22227 100644 --- a/worker/notmuch/lib/database.go +++ b/worker/notmuch/lib/database.go @@ -336,7 +336,11 @@ func (db *DB) makeThread(parent *types.Thread, msgs *notmuch.Messages, threadCon case true: node.Context = !match default: - node.Hidden = !match + if match { + node.Hidden = 0 + } else { + node.Hidden = 1 + } } if parent != nil && parent.FirstChild == nil { parent.FirstChild = node diff --git a/worker/types/thread.go b/worker/types/thread.go index 75651280..b4f5ac5f 100644 --- a/worker/types/thread.go +++ b/worker/types/thread.go @@ -15,7 +15,7 @@ type Thread struct { NextSibling *Thread FirstChild *Thread - Hidden bool // if this flag is set the message isn't rendered in the UI + Hidden int // if this flag is not zero the message isn't rendered in the UI Deleted bool // if this flag is set the message was deleted // Context indicates the message doesn't match the mailbox / query but -- cgit