tweaks: invert a condition, to have two clauses in a more logical order

First the clause for the intro text and the normal lines, and then the
clause for the continuation lines (that are narrower and indented).

Also, avoid blanking the status bar when initializing the subwindows
anyway, and avoid an unneeded resfreshing call -- the bottombars()
function will take care of that.
This commit is contained in:
Benno Schulenberg 2020-04-03 17:19:15 +02:00
parent f3624b1b87
commit 6e5195f650

View File

@ -57,15 +57,15 @@ void wrap_help_text_into_buffer(void)
if (ptr == end_of_intro)
wrapping_point = (COLS < 40) ? 40 : COLS;
if (ptr > end_of_intro && *(ptr - 1) != '\n') {
length = break_line(ptr, (COLS < 40) ? 22 : COLS - 18, TRUE);
oneline = nmalloc(length + 5);
snprintf(oneline, length + 5, "\t\t %s", ptr);
} else {
if (ptr < end_of_intro || *(ptr - 1) == '\n') {
length = break_line(ptr, wrapping_point, TRUE);
oneline = nmalloc(length + 1);
shim = (*(ptr + length - 1) == ' ') ? 0 : 1;
snprintf(oneline, length + shim, "%s", ptr);
} else {
length = break_line(ptr, (COLS < 40) ? 22 : COLS - 18, TRUE);
oneline = nmalloc(length + 5);
snprintf(oneline, length + 5, "\t\t %s", ptr);
}
free(openfile->current->data);
@ -125,8 +125,6 @@ void show_help(void)
linestruct *line;
int length;
blank_statusbar();
/* Save the settings of all flags. */
memcpy(stash, flags, sizeof(flags));
@ -134,7 +132,8 @@ void show_help(void)
if (ISSET(NO_HELP) && LINES > 4) {
UNSET(NO_HELP);
window_init();
}
} else
blank_statusbar();
/* When searching, do it forward, case insensitive, and without regexes. */
UNSET(BACKWARDS_SEARCH);
@ -272,7 +271,7 @@ void show_help(void)
currmenu = oldmenu;
window_init();
} else {
wipe_statusbar();
blank_statusbar();
bottombars(oldmenu);
}