]> granicus.if.org Git - neomutt/commitdiff
Don't exit pager if quit=ask is answered "no".
authorKevin McCarthy <kevin@8t8.us>
Wed, 17 Apr 2013 03:12:25 +0000 (20:12 -0700)
committerKevin McCarthy <kevin@8t8.us>
Wed, 17 Apr 2013 03:12:25 +0000 (20:12 -0700)
This patch addresses ticket 2788.

Currently if you quit ('Q') from inside the pager, with quit=ask-yes
or quit=ask-no, and you respond "no", mutt leaves you back in the index
menu.

This patch changes it so that mutt does not exit the pager.

pager.c

diff --git a/pager.c b/pager.c
index 7b03e902bd92f73ae146d5f130eab53ac39fa07c..486d8c8d6cbcb6fc21f99b93267f230c2ebd8e11 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1927,6 +1927,15 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
        ch = -1;
        break;
 
+      case OP_QUIT:
+       if (query_quadoption (OPT_QUIT, _("Quit Mutt?")) == M_YES)
+       {
+         /* avoid prompting again in the index menu */
+         set_quadoption (OPT_QUIT, M_YES);
+         ch = -1;
+       }
+       break;
+
       case OP_NEXT_PAGE:
        if (lineInfo[curline].offset < sb.st_size-1)
        {