From abd4c47acf4ec71a3eb142e44493d29ba1201465 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 28 Nov 2021 15:35:22 +0100 Subject: [PATCH] feedback: when reporting an unbound function key, mention its number This makes it easier to figure out what to put in their nanorc file when the user wants to bind the key. --- src/nano.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nano.c b/src/nano.c index b87519ea..441a2e4e 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1283,6 +1283,11 @@ void unbound_key(int code) /* TRANSLATORS: This refers to a sequence of escape codes * (from the keyboard) that nano does not recognize. */ statusline(AHEM, _("Unknown sequence")); +#ifndef NANO_TINY + /* TRANSLATORS: This refers to an unbound function key. */ + else if (code > KEY_F0 && code < KEY_F0 + 25) + statusline(AHEM, _("Unbound key: F%i"), code - KEY_F0); +#endif else if (code > 0x7F) statusline(AHEM, _("Unbound key")); else if (meta_key) {