prompt: allow rebinding also ^N, ^Q, and ^Y at the yes-no prompt

Checking for the literal ^N, ^Q, and ^Y before checking for do_toggle
and full_refresh made it impossible to rebind any of those keystrokes
to these two functions.  (Not that anyone would want this, but...)

Problem existed since version 4.3, commits 341601e1 and 82aea04c.
This commit is contained in:
Benno Schulenberg 2022-08-21 09:35:03 +02:00
parent c410ba4d42
commit 210c94d82f
1 changed files with 12 additions and 12 deletions

View File

@ -732,6 +732,18 @@ int ask_user(bool withall, const char *question)
choice = ALL;
else if (func_from_key(kbinput) == do_cancel)
choice = CANCEL;
else if (func_from_key(kbinput) == full_refresh)
full_refresh();
#ifndef NANO_TINY
else if (func_from_key(kbinput) == do_toggle) {
TOGGLE(NO_HELP);
window_init();
titlebar(NULL);
focusing = FALSE;
edit_refresh();
focusing = TRUE;
}
#endif
/* Interpret ^N and ^Q as "No", to allow exiting in anger. */
else if (kbinput == '\x0E' || kbinput == '\x11')
choice = NO;
@ -755,18 +767,6 @@ int ask_user(bool withall, const char *question)
choice = UNDECIDED;
}
}
#endif
else if (func_from_key(kbinput) == full_refresh)
full_refresh();
#ifndef NANO_TINY
else if (func_from_key(kbinput) == do_toggle) {
TOGGLE(NO_HELP);
window_init();
titlebar(NULL);
focusing = FALSE;
edit_refresh();
focusing = TRUE;
}
#endif
else
beep();