summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2015-10-04 10:08:49 +0800
committerKevin McCarthy <kevin@8t8.us>2015-10-04 10:08:49 +0800
commit53900afab2a72921e95e33c23a89087f3f73d890 (patch)
treea995d348eb32d98d92f56a26ebf40bcdc1e2c14a /menu.c
parentf358cf9ad832c6b3ede537448da1d4a851275b7d (diff)
Create a separate macro/push/exec event buffer. (closes #3779)
Currently, the SSL and TLS certficate prompts turn on OPTUNBUFFEREDINPUT, (to prevent macros and such from running right through the dialog). Unfortunately, the menu dialog processing in menu_dialog_dokey() is using mutt_ungetch() to forward non-dialog keys on to standard menu processing. With OPTUNBUFFEREDINPUT set, those keys never make it to the menu and are buffered until after the menu dialog. This patch creates a new event buffer, separate from the standard "unget" buffer, for use by macros, exec, and push events. These events can be temporarily ignored by setting OPTIGNOREMACROEVENTS (renamed from OPTUNBUFFEREDINPUT), while continuing to allow unget events to be processed. Since the "push" and "unget" functions now go to different buffers, function names were slightly renamed, to make it less easy to unintentionally use the wrong function at the wrong time.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/menu.c b/menu.c
index 578593eb..828df9c1 100644
--- a/menu.c
+++ b/menu.c
@@ -25,8 +25,6 @@
#include "mutt_menu.h"
#include "mbyte.h"
-extern size_t UngetCount;
-
char* SearchBuffers[MENU_MAX];
static void print_enriched_string (int attr, unsigned char *s, int do_color)
@@ -415,7 +413,7 @@ void menu_jump (MUTTMENU *menu)
if (menu->max)
{
- mutt_ungetch (LastKey, 0);
+ mutt_unget_event (LastKey, 0);
buf[0] = 0;
if (mutt_get_field (_("Jump to: "), buf, sizeof (buf), 0) == 0 && buf[0])
{
@@ -817,7 +815,7 @@ static int menu_dialog_dokey (MUTTMENU *menu, int *ip)
}
else
{
- mutt_ungetch (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
+ mutt_unget_event (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
return -1;
}
}
@@ -905,12 +903,7 @@ int mutt_menuLoop (MUTTMENU *menu)
}
else /* None tagged, OP_TAG_PREFIX_COND */
{
- event_t tmp;
- while(UngetCount>0)
- {
- tmp=mutt_getch();
- if(tmp.op==OP_END_COND)break;
- }
+ mutt_flush_macro_to_endcond ();
mutt_message _("Nothing to do.");
i = -1;
}