tweaks: rename two variables, to make some sense

And move a statement to a better place.
master
Benno Schulenberg 2016-08-22 10:50:51 +02:00
parent ea9aaee8c7
commit 21cb01e543
1 changed files with 14 additions and 15 deletions

View File

@ -1956,7 +1956,7 @@ void statusbar(const char *msg)
void statusline(message_type importance, const char *msg, ...) void statusline(message_type importance, const char *msg, ...)
{ {
va_list ap; va_list ap;
char *bar, *foo; char *compound, *message;
size_t start_x; size_t start_x;
bool bracketed; bool bracketed;
#ifndef NANO_TINY #ifndef NANO_TINY
@ -1994,25 +1994,22 @@ void statusline(message_type importance, const char *msg, ...)
blank_statusbar(); blank_statusbar();
bar = charalloc(mb_cur_max() * (COLS + 1)); /* Construct the message out of all the arguments. */
vsnprintf(bar, mb_cur_max() * (COLS + 1), msg, ap); compound = charalloc(mb_cur_max() * (COLS + 1));
vsnprintf(compound, mb_cur_max() * (COLS + 1), msg, ap);
va_end(ap); va_end(ap);
foo = display_string(bar, 0, COLS, FALSE); message = display_string(compound, 0, COLS, FALSE);
free(bar); free(compound);
#ifndef NANO_TINY start_x = (COLS - strlenpt(message)) / 2;
if (old_whitespace)
SET(WHITESPACE_DISPLAY);
#endif
start_x = (COLS - strlenpt(foo)) / 2;
bracketed = (start_x > 1); bracketed = (start_x > 1);
wmove(bottomwin, 0, (bracketed ? start_x - 2 : start_x)); wmove(bottomwin, 0, (bracketed ? start_x - 2 : start_x));
wattron(bottomwin, interface_color_pair[STATUS_BAR]); wattron(bottomwin, interface_color_pair[STATUS_BAR]);
if (bracketed) if (bracketed)
waddstr(bottomwin, "[ "); waddstr(bottomwin, "[ ");
waddstr(bottomwin, foo); waddstr(bottomwin, message);
free(foo); free(message);
if (bracketed) if (bracketed)
waddstr(bottomwin, " ]"); waddstr(bottomwin, " ]");
wattroff(bottomwin, interface_color_pair[STATUS_BAR]); wattroff(bottomwin, interface_color_pair[STATUS_BAR]);
@ -2023,10 +2020,12 @@ void statusline(message_type importance, const char *msg, ...)
suppress_cursorpos = TRUE; suppress_cursorpos = TRUE;
/* If we're doing quick statusbar blanking, blank it after just one
* keystroke. Otherwise, blank it after twenty-six keystrokes, as
* Pico does. */
#ifndef NANO_TINY #ifndef NANO_TINY
if (old_whitespace)
SET(WHITESPACE_DISPLAY);
/* If doing quick blanking, blank the statusbar after just one keystroke.
* Otherwise, blank it after twenty-six keystrokes, as Pico does. */
if (ISSET(QUICK_BLANK)) if (ISSET(QUICK_BLANK))
statusblank = 1; statusblank = 1;
else else