From 34cfa55f58502f7fdabccefa7ce4f366be6e23d5 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 18 Sep 2020 16:12:39 +0200 Subject: [PATCH] feedback: show helpful message for the first ^H at the top of the file Typing ^H (by default equivalent to Backspace) at the start of the file is not useful. When it happens, assume that the user is new and tried to ask for Help. So... explain what the caret and the "M-" in the help lines mean. --- src/cut.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cut.c b/src/cut.c index 63130c2a..dea2297e 100644 --- a/src/cut.c +++ b/src/cut.c @@ -128,6 +128,8 @@ void do_delete(void) * character, and then delete the character under the cursor. */ void do_backspace(void) { + static bool give_a_hint = TRUE; + #ifndef NANO_TINY if (openfile->mark && ISSET(LET_THEM_ZAP)) zap_text(); @@ -136,7 +138,10 @@ void do_backspace(void) if (openfile->current_x > 0 || openfile->current != openfile->filetop) { do_left(); do_deletion(BACK); - } + } else if (give_a_hint && !ISSET(NO_HELP)) + statusbar(_("^W = Ctrl+W M-W = Alt+W")); + + give_a_hint = FALSE; } /* Return FALSE when a cut command would not actually cut anything: when