int mutt_change_flag(HEADER * h, int bf)
{
+ char buf[STRING];
+ const char letters[] = "dDnNoOrR*!";
static char const actions[] = {
['d'] = M_DELETE, ['D'] = M_DELETE,
['n'] = M_NEW, ['N'] = M_NEW,
int c;
- mvwprintw(stdscr, LINES - 1, 0, "%s? (D/N/O/r/*/!): ",
+ snprintf(buf, sizeof(buf), "%s? (D/N/O/r/*/!): ",
bf ? _("Set flag") : _("Clear flag"));
- wclrtoeol(stdscr);
- c = mutt_getch().ch;
- CLEARLINE(stdscr, LINES - 1);
- if (c == -1) {
- return (-1);
- }
-
- if (c < 0 || c > countof(actions) || !actions[c]) {
- BEEP();
+ c = mutt_multi_choice(buf, letters);
+ if (c <= 0)
return -1;
- }
-
+ c = letters[c - 1];
if (actions[c] == M_OLD) {
if (h) {
mutt_set_flag(Context, h, M_READ, !bf);