Commit 99733666 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
parent e72db0e3
Showing with 5 additions and 1 deletion
+5 -1
......@@ -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;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment