commit 71574e7a6f23231cfcb9153f27c8e0451d7d7090
parent 821445d284d31827056248334e1ba16764a6dff5
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 29 May 2019 12:44:23 +0200
tweaks: reshuffle some closing and switching to a better place
And rename the function and elide a parameter besides.
Diffstat:
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/help.c b/src/help.c
@@ -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) {
diff --git a/src/proto.h b/src/proto.h
@@ -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);
diff --git a/src/winio.c b/src/winio.c
@@ -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();