changeset: 7011:979f1e669c16
user:      Kevin McCarthy <ke...@8t8.us>
date:      Mon Apr 17 17:40:14 2017 -0700
link:      http://dev.mutt.org/hg/mutt/rev/979f1e669c16

Change the sort prompt to use (s)ort style prompts.

This is consistent with the rest of mutt, and in my opinion, more readable.

changeset: 7012:851a7ec95399
user:      Kevin McCarthy <ke...@8t8.us>
date:      Mon Apr 17 17:40:15 2017 -0700
link:      http://dev.mutt.org/hg/mutt/rev/851a7ec95399

Handle the pager sort prompt inside the pager.

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.

diffs (51 lines):

diff -r 61295113f7ab -r 851a7ec95399 commands.c
--- a/commands.c        Sun Apr 16 14:38:40 2017 -0700
+++ b/commands.c        Mon Apr 17 17:40:15 2017 -0700
@@ -533,12 +533,13 @@
 
   switch (mutt_multi_choice (reverse ?
        /* L10N: The following three are the sort/reverse sort prompts.
-        * Capital letters must match the order of the characters in the third
-        * string.
+        * Letters must match the order of the characters in the third
+        * string.  Note that mutt now supports multiline prompts, so
+        * it's okay for the translation to take up to three lines.
         */
-                            _("Rev-Sort 
Date/Frm/Recv/Subj/tO/Thread/Unsort/siZe/sCore/sPam/Label?: ") :
-                            _("Sort 
Date/Frm/Recv/Subj/tO/Thread/Unsort/siZe/sCore/sPam/Label?: "),
-                            _("dfrsotuzcpl")))
+       _("Rev-Sort 
(d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore/s(p)am/(l)abel?:
 ") :
+       _("Sort 
(d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore/s(p)am/(l)abel?:
 "),
+       _("dfrsotuzcpl")))
   {
   case -1: /* abort - don't resort */
     return -1;
diff -r 61295113f7ab -r 851a7ec95399 pager.c
--- a/pager.c   Sun Apr 16 14:38:40 2017 -0700
+++ b/pager.c   Mon Apr 17 17:40:15 2017 -0700
@@ -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 @@
        }
        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)

Reply via email to