diff --git a/src/help.c b/src/help.c index 96818d5..e243597 100644 --- a/src/help.c +++ b/src/help.c @@ -36,6 +36,18 @@ static char *end_of_intro = NULL; /* The point in the help text where the introductory paragraphs end * and the shortcut descriptions begin. */ +static char *title = NULL; + /* Title of the help text. */ + +/* Refresh the entire help screen. Useful when window size changes. */ +void help_refresh(void) +{ + total_redraw(); + edit_refresh(); + bottombars(currmenu); + titlebar(title); +} + /* Our main help-viewer function. */ void do_help(void) { @@ -51,8 +63,6 @@ void do_help(void) int line_size; int saved_margin = 0; /* For avoiding the line numbers on the help screen. */ - char *title = charalloc(MAX_BUF_SIZE * sizeof(char)); - /* Title of the help text. */ char *saved_answer = answer != NULL ? strdup(answer) : NULL; /* In case user chooses help at prompt, save the string entered, * if any, by the user at the prompt. */ @@ -71,6 +81,7 @@ void do_help(void) assert(help_text != NULL); /* Extract the title from help_text. */ + title = charalloc(MAX_BUF_SIZE * sizeof(char)); ptr = help_text; line_size = break_line(ptr, 74, TRUE); strncpy(title, ptr, line_size); @@ -122,10 +133,10 @@ void do_help(void) open_buffer(tempfilename, FALSE); display_buffer(); + titlebar(title); while (TRUE) { edit_refresh(); - titlebar(title); lastmessage = HUSH; diff --git a/src/nano.c b/src/nano.c index aba39a2..37ffc04 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1372,7 +1372,10 @@ void regenerate_screen(void) window_init(); /* Redraw the contents of the windows that need it. */ - total_refresh(); + if (currmenu == MHELP || currmenu == MFINDINHELP) + help_refresh(); + else + total_refresh(); } /* If allow is FALSE, block any SIGWINCH signal. If allow is TRUE, diff --git a/src/proto.h b/src/proto.h index 4222a32..447503c 100644 --- a/src/proto.h +++ b/src/proto.h @@ -379,6 +379,7 @@ void thanks_for_all_the_fish(void); /* All functions in help.c. */ #ifndef DISABLE_HELP +void help_refresh(void); void do_help(void); void help_init(void); functionptrtype parse_help_input(int *kbinput); diff --git a/src/winio.c b/src/winio.c index 31fbc2b..bf40226 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1949,7 +1949,7 @@ void titlebar(const char *path) /* Figure out the path, prefix and state strings. */ #ifndef DISABLE_BROWSER - if (currmenu == MHELP && path != NULL) + if ((currmenu == MHELP || currmenu == MFINDINHELP) && path != NULL) state = _("View"); else if (path != NULL) prefix = _("DIR:");