prompt: represent newlines as ^J instead of breaking the bar

Also at the yes-no prompt, a 0x0A byte should be displayed as a ^J
instead of splitting the prompt bar in two and spreading it over
two lines.

This fixes https://savannah.gnu.org/bugs/?49934.
master
Benno Schulenberg 2016-12-26 17:31:27 +01:00
parent e72db0e350
commit 9973366685
1 changed files with 5 additions and 1 deletions

View File

@ -723,6 +723,8 @@ int do_prompt(bool allow_tabs,
int do_yesno_prompt(bool all, const char *msg)
{
int response = -2, width = 16;
char *message = display_string(msg, 0, COLS, FALSE);
/* TRANSLATORS: For the next three strings, if possible, specify
* the single-byte shortcuts for both your language and English.
* For example, in French: "OoYy", for both "Oui" and "Yes". */
@ -773,7 +775,7 @@ int do_yesno_prompt(bool all, const char *msg)
/* Color the statusbar over its full width and display the question. */
wattron(bottomwin, interface_color_pair[TITLE_BAR]);
blank_statusbar();
mvwaddnstr(bottomwin, 0, 0, msg, actual_x(msg, COLS - 1));
mvwaddnstr(bottomwin, 0, 0, message, actual_x(message, COLS - 1));
wattroff(bottomwin, interface_color_pair[TITLE_BAR]);
wnoutrefresh(bottomwin);
@ -827,5 +829,7 @@ int do_yesno_prompt(bool all, const char *msg)
}
} while (response == -2);
free(message);
return response;
}