mirror of git://git.sv.gnu.org/nano.git
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, commits341601e1
and82aea04c
.
This commit is contained in:
parent
c410ba4d42
commit
210c94d82f
24
src/prompt.c
24
src/prompt.c
|
@ -732,6 +732,18 @@ int ask_user(bool withall, const char *question)
|
||||||
choice = ALL;
|
choice = ALL;
|
||||||
else if (func_from_key(kbinput) == do_cancel)
|
else if (func_from_key(kbinput) == do_cancel)
|
||||||
choice = 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. */
|
/* Interpret ^N and ^Q as "No", to allow exiting in anger. */
|
||||||
else if (kbinput == '\x0E' || kbinput == '\x11')
|
else if (kbinput == '\x0E' || kbinput == '\x11')
|
||||||
choice = NO;
|
choice = NO;
|
||||||
|
@ -755,18 +767,6 @@ int ask_user(bool withall, const char *question)
|
||||||
choice = UNDECIDED;
|
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
|
#endif
|
||||||
else
|
else
|
||||||
beep();
|
beep();
|
||||||
|
|
Loading…
Reference in New Issue