summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2017-07-19 14:12:01 -0700
committerKevin McCarthy <kevin@8t8.us>2017-07-19 14:12:01 -0700
commit6d3dd4bf85469e5a585ed4a039b3b6d4472e3502 (patch)
treea1a5225817148590618cdf5efa8574c17ff6a5ed /menu.c
parent367b012a6342b9e47faa3579f3403230356a3ab3 (diff)
parent3509e8e3234170026a38d0492124e0c77df6d527 (diff)
merge stable
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/menu.c b/menu.c
index 9605d73f..8a6be010 100644
--- a/menu.c
+++ b/menu.c
@@ -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;