feedback: don't give a hint for <Bsp>, and not after an Alt+key was used

master
Benno Schulenberg 2020-09-19 12:09:50 +02:00
parent a2878bff67
commit 89f8d71001
2 changed files with 9 additions and 6 deletions

View File

@ -128,8 +128,6 @@ 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();
@ -138,10 +136,7 @@ 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

View File

@ -1526,6 +1526,7 @@ void process_a_keystroke(void)
/* The input buffer for actual characters. */
static size_t depth = 0;
/* The length of the input buffer. */
static bool give_a_hint = TRUE;
const keystruct *shortcut;
/* Read in a keystroke, and show the cursor while waiting. */
@ -1591,6 +1592,13 @@ void process_a_keystroke(void)
return;
}
if (input == '\b' && give_a_hint && openfile->current_x == 0 &&
openfile->current == openfile->filetop && !ISSET(NO_HELP)) {
statusbar(_("^W = Ctrl+W M-W = Alt+W"));
give_a_hint = FALSE;
} else if (meta_key)
give_a_hint = FALSE;
/* When not cutting or copying text, drop the cutbuffer the next time. */
if (shortcut->func != cut_text) {
#ifndef NANO_TINY