From 47c9e204d88255c91f6c6546e7fbc3e5180bea8e Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Mon, 17 Apr 2017 17:40:15 -0700 Subject: [PATCH] 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. --- pager.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pager.c b/pager.c index 0518ff1f6..e3ce47cc0 100644 --- 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) -- 2.40.0