]> granicus.if.org Git - neomutt/commitdiff
Set pager's REDRAW_SIGWINCH when reflowing windows.
authorKevin McCarthy <kevin@8t8.us>
Sat, 15 Apr 2017 19:56:46 +0000 (12:56 -0700)
committerRichard Russon <rich@flatcap.org>
Tue, 18 Apr 2017 12:44:29 +0000 (13:44 +0100)
So that all external reflow handling functions don't have to remember
to set the flag too.

curs_lib.c
pager.c

index 7ab302f97d9489b80c027680f1e666ff4a4f7b70..1a54206cec870018c783faba8f4325be6c4d842d 100644 (file)
@@ -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 c282f46205dda0d63a087898d32f2a245bdf76fd..0518ff1f6be28059baf5bf60af0eea2882d473fa 100644 (file)
--- 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;