commit 34cfa55f58502f7fdabccefa7ce4f366be6e23d5
parent 7dd5484cb554cd6c09d3d9a407c3e7c16f74a162
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 18 Sep 2020 16:12:39 +0200
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.
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git 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