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.
This commit is contained in:
Benno Schulenberg 2020-09-18 16:12:39 +02:00
parent 7dd5484cb5
commit 34cfa55f58

View File

@ -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