summaryrefslogtreecommitdiffstats
path: root/curs_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'curs_lib.c')
-rw-r--r--curs_lib.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/curs_lib.c b/curs_lib.c
index 18f75e3d..7a5a3f54 100644
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -784,10 +784,14 @@ void mutt_reflow_windows (void)
if (option (OPTSIDEBAR))
{
memcpy (MuttSidebarWindow, MuttIndexWindow, sizeof (mutt_window_t));
- MuttSidebarWindow->cols = SidebarWidth;
-
- MuttIndexWindow->cols -= SidebarWidth;
- MuttIndexWindow->col_offset += SidebarWidth;
+ MuttSidebarWindow->cols = MAX (SidebarWidth, 0);
+ /* Ensure the index window has at least one column, to prevent
+ * pager regressions. */
+ if (MuttSidebarWindow->cols >= MuttIndexWindow->cols)
+ MuttSidebarWindow->cols = MuttIndexWindow->cols - 1;
+
+ MuttIndexWindow->cols -= MuttSidebarWindow->cols;
+ MuttIndexWindow->col_offset += MuttSidebarWindow->cols;
}
#endif