From: Karel Zak Date: Sun, 13 Oct 2013 18:34:57 +0000 (-0700) Subject: improve entire-thread X-Git-Tag: neomutt-20160404~13^2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01830398f05b73dc146a68353ae6b5c9569c9f40;p=neomutt improve entire-thread - don't support mutt tags, always work with the current message only - support collapsed threads - add "No more messages in the thread" message Signed-off-by: Karel Zak --- diff --git a/curs_main.c b/curs_main.c index e7a6231a8..11ca9f755 100644 --- a/curs_main.c +++ b/curs_main.c @@ -1393,29 +1393,22 @@ int mutt_index_menu (void) } CHECK_MSGCOUNT; CHECK_VISIBLE; - if (tag) - { - nm_longrun_init(Context, FALSE); - for (j = 0; j < Context->vcount; j++) { - if (Context->hdrs[Context->v2r[j]]->tagged) - nm_read_entire_thread(Context, Context->hdrs[Context->v2r[j]]); - } - nm_longrun_done(Context); - } - else - { - if (nm_read_entire_thread(Context, CURHDR) < 0) { - mutt_message _("Failed to read thread, aborting."); - break; - } + if (nm_read_entire_thread(Context, CURHDR) < 0) { + mutt_message _("Failed to read thread, aborting."); + break; } if (oldcount < Context->msgcount) { HEADER *oldcur = CURHDR; if ((Sort & SORT_MASK) == SORT_THREADS) - mutt_sort_headers (Context, 1); + mutt_sort_headers (Context, 0); menu->current = oldcur->virtual; menu->redraw = REDRAW_STATUS | REDRAW_INDEX; + + if (oldcur->collapsed || Context->collapsed) { + menu->current = mutt_uncollapse_thread(Context, CURHDR); + mutt_set_virtual(Context); + } } break; } diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 3b54627ff..5e6e5a367 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -1165,6 +1165,9 @@ done: if (!is_longrun(data)) release_db(data); + if (ctx->msgcount == data->oldmsgcount) + mutt_message _("No more messages in the thread."); + data->oldmsgcount = 0; dprint(1, (debugfile, "nm: reading entire-thread messages... done [rc=%d, count=%d]\n", rc, ctx->msgcount));