]> granicus.if.org Git - neomutt/commitdiff
Handle the pager sort prompt inside the pager.
authorKevin McCarthy <kevin@8t8.us>
Tue, 18 Apr 2017 00:40:15 +0000 (17:40 -0700)
committerRichard Russon <rich@flatcap.org>
Tue, 18 Apr 2017 12:44:29 +0000 (13:44 +0100)
Display the prompt in the pager, so a multiline prompt or resize
doesn't refresh the index menu.  Then, bounce back through the index
to handle resorting and status line updates.

This also fixes cancelling to stay in the pager.

pager.c

diff --git a/pager.c b/pager.c
index 0518ff1f6be28059baf5bf60af0eea2882d473fa..e3ce47cc0d204e978aa1c728b22da8f0bbe4b9a2 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -33,6 +33,7 @@
 #include "mutt_curses.h"
 #include "mutt_menu.h"
 #include "mutt_regex.h"
+#include "sort.h"
 #ifdef USE_SIDEBAR
 #include "sidebar.h"
 #endif
@@ -2484,6 +2485,17 @@ int mutt_pager(const char *banner, const char *fname, int flags, pager_t *extra)
         }
         break;
 
+      case OP_SORT:
+      case OP_SORT_REVERSE:
+        CHECK_MODE(IsHeader(extra))
+        if (mutt_select_sort((ch == OP_SORT_REVERSE)) == 0)
+        {
+          set_option(OPTNEEDRESORT);
+          ch = -1;
+          rc = OP_DISPLAY_MESSAGE;
+        }
+        break;
+
       case OP_HELP:
         /* don't let the user enter the help-menu from the help screen! */
         if (!InHelp)