From 20e122ef41816dc4c4a4afedaa5d23e934db95c2 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 1 Apr 2021 09:45:55 +0200 Subject: [PATCH] startup: show the helpful message only when ^G has not been rebound (Well, it now checks that ^G is still the first shortcut that is bound to 'do_help', but that is good enough: if the user did any rebinding, they probably do not need any reminder about how to invoke 'Help'.) This fixes https://savannah.gnu.org/bugs/?60315. Reported-by: Robert Goulding --- src/nano.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nano.c b/src/nano.c index 9f725f34..6e40ab12 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2502,11 +2502,16 @@ int main(int argc, char **argv) #ifdef ENABLE_NANORC if (startup_problem != NULL) statusline(ALERT, startup_problem); + +#define NOTREBOUND first_sc_for(MMAIN, do_help) && \ + first_sc_for(MMAIN, do_help)->keycode == 0x07 +#else +#define NOTREBOUND TRUE #endif #ifdef ENABLE_HELP if (*openfile->filename == '\0' && openfile->totsize == 0 && - openfile->next == openfile && !ISSET(NO_HELP)) + openfile->next == openfile && !ISSET(NO_HELP) && NOTREBOUND) statusbar(_("Welcome to nano. For basic help, type Ctrl+G.")); #endif