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).
master
Benno Schulenberg 2020-05-22 11:58:28 +02:00
parent 53c5ace8c3
commit 2c5045bfce
3 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -147,7 +147,7 @@ typedef enum {
} format_type;
typedef enum {
HUSH, NOTICE, MILD, ALERT
VACUUM, HUSH, NOTICE, MILD, ALERT
} message_type;
typedef enum {

View File

@ -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