]> 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)
committerKevin McCarthy <kevin@8t8.us>
Tue, 18 Apr 2017 00:40:15 +0000 (17:40 -0700)
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 2ebfaceab1aefb9b6bfe68729a8b339e5b9298c4..e869ca29a00a53006c0d14df8ae33571a4373d9f 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -29,6 +29,7 @@
 #include "pager.h"
 #include "attach.h"
 #include "mbyte.h"
+#include "sort.h"
 #ifdef USE_SIDEBAR
 #include "sidebar.h"
 #endif
@@ -2335,6 +2336,17 @@ search_next:
        }
        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)