]> granicus.if.org Git - neomutt/commitdiff
Enable reconstruct-thread in the pager
authorWieland Hoffmann <themineo@gmail.com>
Mon, 28 Nov 2016 18:44:27 +0000 (19:44 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 30 Nov 2016 13:31:35 +0000 (13:31 +0000)
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
curs_main.c
functions.h

index 32e3ed3887008c5d9794ed1b52b3683aeddc6d8b..480ad08557e0505b0d4b6ad9ef4d5e724cb64a8f 100644 (file)
@@ -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
index 07f69ac1827465706320ba7b5d8dcad403205d47..877ce7e05a4da3f82e63d33c5c223a6b2ba81bac 100644 (file)
@@ -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" },