From: Kevin McCarthy Date: Sat, 15 Apr 2017 19:56:46 +0000 (-0700) Subject: Set pager's REDRAW_SIGWINCH when reflowing windows. X-Git-Tag: neomutt-20170421~12^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50b2cb2dc8ed502459353abf15997b3dc6e190b9;p=neomutt Set pager's REDRAW_SIGWINCH when reflowing windows. So that all external reflow handling functions don't have to remember to set the flag too. --- diff --git a/curs_lib.c b/curs_lib.c index 7ab302f97..1a54206ce 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -167,9 +167,6 @@ int _mutt_get_field(const char *field, char *buf, size_t buflen, int complete, { SigWinch = 0; mutt_resize_screen(); - /* mutt_resize_screen sets REDRAW_FULL, but the pager also - * requires SIGWINCH. */ - mutt_set_current_menu_redraw(REDRAW_SIGWINCH); clearok(stdscr, TRUE); mutt_current_menu_redraw(); } @@ -627,6 +624,8 @@ void mutt_reflow_windows(void) #endif mutt_set_current_menu_redraw_full(); + /* the pager menu needs this flag set to recalc lineInfo */ + mutt_set_current_menu_redraw(REDRAW_SIGWINCH); } static void reflow_message_window_rows(int mw_rows) @@ -647,6 +646,8 @@ static void reflow_message_window_rows(int mw_rows) MuttSidebarWindow->rows = MuttIndexWindow->rows; #endif + /* We don't also set REDRAW_SIGWINCH because this function only + * changes rows and is a temporary adjustment. */ mutt_set_current_menu_redraw_full(); } @@ -976,7 +977,6 @@ int mutt_multi_choice(char *prompt, char *letters) { SigWinch = 0; mutt_resize_screen(); - mutt_set_current_menu_redraw(REDRAW_SIGWINCH); clearok(stdscr, TRUE); mutt_current_menu_redraw(); } diff --git a/pager.c b/pager.c index c282f4620..0518ff1f6 100644 --- a/pager.c +++ b/pager.c @@ -2173,7 +2173,8 @@ int mutt_pager(const char *banner, const char *fname, int flags, pager_t *extra) } else { - pager_menu->redraw = REDRAW_FULL | REDRAW_SIGWINCH; + /* note: mutt_resize_screen() -> mutt_reflow_windows() sets + * REDRAW_FULL and REDRAW_SIGWINCH */ ch = 0; } continue;