diff options
author | Kevin McCarthy <kevin@8t8.us> | 2017-07-19 14:12:01 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2017-07-19 14:12:01 -0700 |
commit | 6d3dd4bf85469e5a585ed4a039b3b6d4472e3502 (patch) | |
tree | a1a5225817148590618cdf5efa8574c17ff6a5ed | |
parent | 367b012a6342b9e47faa3579f3403230356a3ab3 (diff) | |
parent | 3509e8e3234170026a38d0492124e0c77df6d527 (diff) |
merge stable
-rw-r--r-- | imap/command.c | 13 | ||||
-rw-r--r-- | imap/imap.c | 2 | ||||
-rw-r--r-- | menu.c | 17 |
3 files changed, 24 insertions, 8 deletions
diff --git a/imap/command.c b/imap/command.c index 87802dcd..ad322892 100644 --- a/imap/command.c +++ b/imap/command.c @@ -147,8 +147,17 @@ int imap_cmd_step (IMAP_DATA* idata) if (idata->buf[0] == '+') return IMAP_CMD_RESPOND; - /* look for tagged command completions */ - rc = IMAP_CMD_CONTINUE; + /* Look for tagged command completions. + * + * Some response handlers can end up recursively calling + * imap_cmd_step() and end up handling all tagged command + * completions. + * (e.g. FETCH->set_flag->set_header_color->~h pattern match.) + * + * Other callers don't even create an idata->cmds entry. + * + * For both these cases, we default to returning OK */ + rc = IMAP_CMD_OK; c = idata->lastcmd; do { diff --git a/imap/imap.c b/imap/imap.c index f1fc49a9..387801e6 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -420,7 +420,7 @@ int imap_open_connection (IMAP_DATA* idata) idata->state = IMAP_CONNECTED; - if (imap_cmd_step (idata) != IMAP_CMD_CONTINUE) + if (imap_cmd_step (idata) != IMAP_CMD_OK) { imap_close_connection (idata); return -1; @@ -297,15 +297,21 @@ void menu_redraw_index (MUTTMENU *menu) void menu_redraw_motion (MUTTMENU *menu) { char buf[LONG_STRING]; + int old_color, cur_color; if (menu->dialog) { menu->redraw &= ~REDRAW_MOTION; return; } - + + /* Note: menu->color() for the index can end up retrieving a message + * over imap (if matching against ~h for instance). This can + * generate status messages. So we want to call it *before* we + * position the cursor for drawing. */ + old_color = menu->color (menu->oldcurrent); mutt_window_move (menu->indexwin, menu->oldcurrent + menu->offset - menu->top, 0); - ATTRSET(menu->color (menu->oldcurrent)); + ATTRSET(old_color); if (option (OPTARROWCURSOR)) { @@ -317,7 +323,7 @@ void menu_redraw_motion (MUTTMENU *menu) menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent); menu_pad_string (menu, buf, sizeof (buf)); mutt_window_move (menu->indexwin, menu->oldcurrent + menu->offset - menu->top, 3); - print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1); + print_enriched_string (old_color, (unsigned char *) buf, 1); } /* now draw it in the new location */ @@ -329,14 +335,15 @@ void menu_redraw_motion (MUTTMENU *menu) /* erase the current indicator */ menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent); menu_pad_string (menu, buf, sizeof (buf)); - print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1); + print_enriched_string (old_color, (unsigned char *) buf, 1); /* now draw the new one to reflect the change */ + cur_color = menu->color (menu->current); menu_make_entry (buf, sizeof (buf), menu, menu->current); menu_pad_string (menu, buf, sizeof (buf)); SETCOLOR(MT_COLOR_INDICATOR); mutt_window_move (menu->indexwin, menu->current + menu->offset - menu->top, 0); - print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0); + print_enriched_string (cur_color, (unsigned char *) buf, 0); } menu->redraw &= REDRAW_STATUS; NORMAL_COLOR; |