commit 2c5045bfce1f099d5f48223a4ea490ebd20ca15f
parent 53c5ace8c351b25ee64adcae383944d64c492f7d
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 22 May 2020 11:58:28 +0200
feedback: skip wiping the prompt bar when the shortcut printed a message
When, at a prompt, the user chose a function shortcut instead of typing
an answer, and this function printed some message to the status bar,
then we do not want to wipe this message. Also: the message overwrote
and cleared the prompt bar, so there is no need to wipe the latter.
This fixes https://savannah.gnu.org/bugs/?56273.
Bug existed since version 4.0, since justifying started giving feedback
(or rather since version 4.1, since M-J no longer crashed).
Diffstat:
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -2455,7 +2455,7 @@ int main(int argc, char **argv)
if (currmenu != MMAIN)
bottombars(MMAIN);
- lastmessage = HUSH;
+ lastmessage = VACUUM;
as_an_at = TRUE;
/* Update the displayed current cursor position only when there
diff --git a/src/nano.h b/src/nano.h
@@ -147,7 +147,7 @@ typedef enum {
} format_type;
typedef enum {
- HUSH, NOTICE, MILD, ALERT
+ VACUUM, HUSH, NOTICE, MILD, ALERT
} message_type;
typedef enum {
diff --git a/src/prompt.c b/src/prompt.c
@@ -580,6 +580,8 @@ int do_prompt(bool allow_tabs, bool allow_files,
/* Reserve five columns for colon plus angles plus answer, ":<aa>". */
prompt[actual_x(prompt, (COLS < 5) ? 0 : COLS - 5)] = '\0';
+ lastmessage = VACUUM;
+
func = acquire_an_answer(&retval, allow_tabs, allow_files, &listed,
history_list, refresh_func);
free(prompt);
@@ -602,7 +604,8 @@ int do_prompt(bool allow_tabs, bool allow_files,
else if (func == do_enter)
retval = (*answer == '\0') ? -2 : 0;
- wipe_statusbar();
+ if (lastmessage == VACUUM)
+ wipe_statusbar();
#ifdef ENABLE_TABCOMP
/* If we've done tab completion, there might still be a list of