From 8d974cd2922db2222be7b3d3e6f47899b98f6ec8 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 10 May 2021 17:03:17 +0200 Subject: [PATCH] statusbar: on a one-row terminal, drop light messages after a few moments Only important error messages (ALERT) and information that the user requested (^C, M-D) should stay put until the next keystroke. Other messages should be overwritten by the text of the buffer after just a few moments, to make a one-row terminal slightly more friendly. This addresses https://savannah.gnu.org/bugs/?60570. --- src/winio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/winio.c b/src/winio.c index 7433eccc..4bca80d7 100644 --- a/src/winio.c +++ b/src/winio.c @@ -193,7 +193,7 @@ void read_keys_from(WINDOW *win) curs_set(1); #ifndef NANO_TINY - if (currmenu == MMAIN && ISSET(MINIBAR) && LINES > 1 && lastmessage > HUSH && + if (currmenu == MMAIN && (ISSET(MINIBAR) || LINES == 1) && lastmessage > HUSH && lastmessage != INFO && lastmessage < ALERT) { timed = TRUE; halfdelay(ISSET(QUICK_BLANK) ? 8 : 15); @@ -216,7 +216,11 @@ void read_keys_from(WINDOW *win) raw(); if (input == ERR) { - minibar(); + if (LINES == 1) { + edit_refresh(); + curs_set(1); + } else + minibar(); as_an_at = TRUE; place_the_cursor(); doupdate();