From eff4b9365281325a37ead1c6ae8ed77823b7037f Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Sun, 15 Dec 2024 21:56:54 +0000 Subject: [PATCH] acme/Mail: correct message line number for partially hidden threads --- sys/src/cmd/upas/Mail/mbox.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/src/cmd/upas/Mail/mbox.c b/sys/src/cmd/upas/Mail/mbox.c index 70a87c4b4..d2801152b 100644 --- a/sys/src/cmd/upas/Mail/mbox.c +++ b/sys/src/cmd/upas/Mail/mbox.c @@ -159,8 +159,9 @@ nsub(Mesg *m) n = 0; for(i = 0; i < m->nchild; i++){ c = m->child[i]; + n += nsub(c); if(!(c->state & (Sdummy|Shide))) - n += nsub(c)+1; + n++; } return n; } @@ -183,7 +184,9 @@ mesglineno(Mesg *msg, int *depth) for(i = 0; i < p->nchild; i++){ if(p->child[i] == m) break; - o += nsub(p->child[i]) + 1; + o += nsub(p->child[i]); + if(!(p->state & (Sdummy|Shide))) + o++; } if(!(p->state & (Sdummy|Shide))){ o++;