1
1

prompt: for a Yes-No-All, accept the first character of an external paste

Allow the user to paste in the character for Yes, No, or All.  If the
paste contains more than one character, ignore all but the first.

This fully fixes https://savannah.gnu.org/bugs/?57623.
Reported-by: Brand Huntsman <alpha@qzx.com>
Этот коммит содержится в:
Benno Schulenberg 2020-01-26 12:22:49 +01:00
родитель f8553f6d3a
Коммит e3f6638a76

Просмотреть файл

@ -708,6 +708,12 @@ int do_yesno_prompt(bool all, const char *msg)
/* When not replacing, show the cursor while waiting for a key. */
kbinput = get_kbinput(bottomwin, !all);
#ifndef NANO_TINY
/* Accept the first character of an external paste. */
if (bracketed_paste && kbinput == BRACKETED_PASTE_MARKER)
kbinput = get_kbinput(bottomwin, BLIND);
#endif
#ifdef ENABLE_NLS
letter[index++] = (unsigned char)kbinput;
#ifdef ENABLE_UTF8
@ -765,6 +771,12 @@ int do_yesno_prompt(bool all, const char *msg)
#endif /* ENABLE_MOUSE */
else
beep();
#ifndef NANO_TINY
/* Ignore the rest of an external paste. */
while (bracketed_paste)
kbinput = get_kbinput(bottomwin, BLIND);
#endif
}
return choice;