commit cb841de3fc993a16cccd99ef4d314781b98daf3f
parent e12f397140d2e643139730d1ab1c736cda251235
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 17 Sep 2020 19:30:18 +0200
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.
Diffstat:
3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -1310,6 +1310,7 @@ void unbound_key(int code)
else
statusline(ALERT, _("Unbound key: %c"), code);
#endif
+ set_blankdelay_to_one();
}
#ifdef ENABLE_MOUSE
diff --git a/src/prototypes.h b/src/prototypes.h
@@ -592,6 +592,7 @@ void blank_statusbar(void);
void wipe_statusbar(void);
void blank_bottombars(void);
void check_statusblank(void);
+void set_blankdelay_to_one(void);
char *display_string(const char *buf, size_t column, size_t span,
bool isdata, bool isprompt);
void titlebar(const char *path);
diff --git a/src/winio.c b/src/winio.c
@@ -1694,6 +1694,12 @@ void check_statusblank(void)
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
* 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