tweaks: reshuffle some closing and switching to a better place

And rename the function and elide a parameter besides.
master
Benno Schulenberg 2019-05-29 12:44:23 +02:00
parent 821445d284
commit 71574e7a6f
3 changed files with 8 additions and 11 deletions

View File

@ -40,16 +40,11 @@ static size_t location;
/* The offset (in bytes) of the topleft of the shown help text. */
/* Hard-wrap the concatenated help text, and write it into a new buffer. */
void wrap_the_help_text(bool redisplaying)
void wrap_help_text_into_buffer()
{
size_t sum = 0;
const char *ptr = start_of_body;
if (redisplaying) {
close_buffer();
switch_to_prev_buffer();
}
make_new_buffer();
/* Copy the help text into the just-created new buffer. */
@ -166,7 +161,7 @@ void do_help(void)
while (*start_of_body == '\n')
start_of_body++;
wrap_the_help_text(FALSE);
wrap_help_text_into_buffer();
edit_refresh();
while (TRUE) {

View File

@ -329,7 +329,7 @@ char *menu_to_name(int menu);
/* All functions in help.c. */
#ifdef ENABLE_HELP
void wrap_the_help_text(bool redisplaying);
void wrap_help_text_into_buffer();
void do_help(void);
void help_init(void);
functionptrtype parse_help_input(int *kbinput);

View File

@ -3373,9 +3373,11 @@ void total_refresh(void)
if (currmenu != MBROWSER && currmenu != MWHEREISFILE && currmenu != MGOTODIR)
titlebar(title);
#ifdef ENABLE_HELP
if (inhelp)
wrap_the_help_text(TRUE);
else
if (inhelp) {
close_buffer();
switch_to_prev_buffer();
wrap_help_text_into_buffer();
} else
#endif
if (currmenu != MBROWSER && currmenu != MWHEREISFILE && currmenu != MGOTODIR)
edit_refresh();