diff options
author | Kevin McCarthy <kevin@8t8.us> | 2015-10-04 10:08:49 +0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2015-10-04 10:08:49 +0800 |
commit | 53900afab2a72921e95e33c23a89087f3f73d890 (patch) | |
tree | a995d348eb32d98d92f56a26ebf40bcdc1e2c14a /curs_main.c | |
parent | f358cf9ad832c6b3ede537448da1d4a851275b7d (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 'curs_main.c')
-rw-r--r-- | curs_main.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/curs_main.c b/curs_main.c index 425bd9ae..48fa6bbc 100644 --- a/curs_main.c +++ b/curs_main.c @@ -109,8 +109,6 @@ static const char *No_visible = N_("No visible messages."); #define OLDHDR Context->hdrs[Context->v2r[menu->oldcurrent]] #define UNREAD(h) mutt_thread_contains_unread (Context, h) -extern size_t UngetCount; - /* de facto standard escapes for tsl/fsl */ static char *tsl = "\033]0;"; static char *fsl = "\007"; @@ -729,12 +727,7 @@ int mutt_index_menu (void) if (!Context->tagged) { - 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."); continue; } @@ -819,7 +812,7 @@ int mutt_index_menu (void) CHECK_MSGCOUNT; CHECK_VISIBLE; - if (isdigit (LastKey)) mutt_ungetch (LastKey, 0); + if (isdigit (LastKey)) mutt_unget_event (LastKey, 0); buf[0] = 0; if (mutt_get_field (_("Jump to message: "), buf, sizeof (buf), 0) != 0 || !buf[0]) |