From c11569fb9907e2c4c8d335ff5e95acd8ff38d0be Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 27 Oct 2025 15:31:06 +0100 Subject: [PATCH] display: upon resize, redraw the subwindows only when fully initialized Otherwise 'currmenu' still has an invalid value, causing a division by zero in bottombars() because shown_entries_for() returns zero. This fixes the first part of https://savannah.gnu.org/bugs/?67635. The issue was reported by `twofiftysix`. Bug existed since version 8.6, commit 09d574ba. --- src/nano.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nano.c b/src/nano.c index 9cf3dfbe..1dd0b8fb 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1073,8 +1073,8 @@ void regenerate_screen(void) terminal_init(); window_init(); - /* If we have an open buffer, redraw the contents of the subwindows. */ - if (openfile) { + /* Only when fully initialized, redraw the contents of the subwindows. */ + if (we_are_running) { ensure_firstcolumn_is_aligned(); draw_all_subwindows(); }