feedback: make an "Unbound key" message disappear on the next keystroke

When nano reports "Unbound key" or "Unknown sequence", this message
should stay onscreen only for the relevant keystroke, not for any
succeeding keystroke.

This addresses https://savannah.gnu.org/bugs/?59119.

Bug existed since before version 2.0.6.
master
Benno Schulenberg 2020-09-17 19:30:18 +02:00
parent e12f397140
commit cb841de3fc
3 changed files with 8 additions and 0 deletions

View File

@ -1310,6 +1310,7 @@ void unbound_key(int code)
else else
statusline(ALERT, _("Unbound key: %c"), code); statusline(ALERT, _("Unbound key: %c"), code);
#endif #endif
set_blankdelay_to_one();
} }
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE

View File

@ -592,6 +592,7 @@ void blank_statusbar(void);
void wipe_statusbar(void); void wipe_statusbar(void);
void blank_bottombars(void); void blank_bottombars(void);
void check_statusblank(void); void check_statusblank(void);
void set_blankdelay_to_one(void);
char *display_string(const char *buf, size_t column, size_t span, char *display_string(const char *buf, size_t column, size_t span,
bool isdata, bool isprompt); bool isdata, bool isprompt);
void titlebar(const char *path); void titlebar(const char *path);

View File

@ -1694,6 +1694,12 @@ void check_statusblank(void)
edit_refresh(); edit_refresh();
} }
/* Ensure that the status bar will be wiped upon the next keystroke. */
void set_blankdelay_to_one(void)
{
statusblank = 1;
}
/* Convert buf into a string that can be displayed on screen. The caller /* Convert buf into a string that can be displayed on screen. The caller
* wants to display buf starting with the given column, and extending for * wants to display buf starting with the given column, and extending for
* at most span columns. column is zero-based, and span is one-based, so * at most span columns. column is zero-based, and span is one-based, so