nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 20e122ef41816dc4c4a4afedaa5d23e934db95c2
parent 0dcac9188f9da7d98e31aa12ad2288bc9c83f796
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  1 Apr 2021 09:45:55 +0200

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 <goulding.2@nd.edu>

Diffstat:
Msrc/nano.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 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