commit 6e5195f650fb7bcaaf596119105662ba4b2df449
parent f3624b1b87a5a2c9c9aec7f7e2e908a7d651c9cc
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 3 Apr 2020 17:19:15 +0200
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.
Diffstat:
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/help.c b/src/help.c
@@ -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);
}