rcfile: do not accept rebinding F0 nor function keys above F16

To match the documentation and to match what the nanorc.nanorc
colors as valid.

In theory it would be possible to allow rebinding also F17...F63,
but nano does not recognize escape sequences for these high-order
function keys.  As no one ever complained about unknown sequences
when pressing function keys, I am guessing that no one has these
high-order keys, or at least that no one uses them.

This fixes https://savannah.gnu.org/bugs/?54332.
master
Benno Schulenberg 2018-07-19 19:47:49 +02:00
parent 4a268678a5
commit 8d8f5788ce
1 changed files with 1 additions and 1 deletions

View File

@ -461,7 +461,7 @@ int keycode_from_string(const char *keystring)
return -1;
} else if (keystring[0] == 'F') {
int fn = atoi(&keystring[1]);
if (fn < 0 || fn > 63)
if (fn < 1 || fn > 16)
return -1;
return KEY_F0 + fn;
} else if (!strcasecmp(keystring, "Ins"))