From: Wieland Hoffmann Date: Mon, 28 Nov 2016 18:44:27 +0000 (+0100) Subject: Enable reconstruct-thread in the pager X-Git-Tag: neomutt-20170113~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6df4c605a03656e7b97dbb8515f6dbf927ed19c3;p=neomutt Enable reconstruct-thread in the pager Make reconstruct-thread in the pager behave more like entire-thread in the pager This means keep displaying the message that was displayed when reconstruct-thread was called, but redisplaying the index. Closes: #260 --- diff --git a/curs_main.c b/curs_main.c index 32e3ed388..480ad0855 100644 --- a/curs_main.c +++ b/curs_main.c @@ -1311,6 +1311,7 @@ int mutt_index_menu (void) /* at least one message has been loaded */ if (Context->msgcount > oldmsgcount) { + HEADER *oldcur = CURHDR; HEADER *hdr; int i, quiet = Context->quiet; @@ -1319,6 +1320,16 @@ int mutt_index_menu (void) mutt_sort_headers (Context, (op == OP_RECONSTRUCT_THREAD)); Context->quiet = quiet; + /* Similar to OP_MAIN_ENTIRE_THREAD, keep displaying the old message, but + update the index */ + if (menu->menu == MENU_PAGER) + { + menu->current = oldcur->virtual; + menu->redraw = REDRAW_STATUS | REDRAW_INDEX; + op = OP_DISPLAY_MESSAGE; + continue; + } + /* if the root message was retrieved, move to it */ hdr = hash_find (Context->id_hash, buf); if (hdr) @@ -1342,7 +1353,16 @@ int mutt_index_menu (void) menu->redraw = REDRAW_FULL; } else if (rc >= 0) + { mutt_error _("No deleted messages found in the thread."); + /* Similar to OP_MAIN_ENTIRE_THREAD, keep displaying the old message, but + update the index */ + if (menu->menu == MENU_PAGER) + { + op = OP_DISPLAY_MESSAGE; + continue; + } + } } break; #endif diff --git a/functions.h b/functions.h index 07f69ac18..877ce7e05 100644 --- a/functions.h +++ b/functions.h @@ -275,6 +275,9 @@ const struct binding_t OpPager[] = { /* map: pager */ { "exit", OP_EXIT, "q" }, { "reply", OP_REPLY, "r" }, { "recall-message", OP_RECALL_MESSAGE, "R" }, +#ifdef USE_NNTP + { "reconstruct-thread", OP_RECONSTRUCT_THREAD, NULL }, +#endif { "read-thread", OP_MAIN_READ_THREAD, "\022" }, { "read-subthread", OP_MAIN_READ_SUBTHREAD, "\033r" }, { "resend-message", OP_RESEND, "\033e" },