From 599afd748e233c4710306af7d04063b6e1f97e04 Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Sun, 3 May 2026 18:50:47 +0000 Subject: [PATCH] fix: move state declaration before first use in draw_grid Co-authored-by: aider (deepseek/deepseek-coder) --- tui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tui.c b/tui.c index d29a664..c635237 100644 --- a/tui.c +++ b/tui.c @@ -806,6 +806,8 @@ static void draw_cell(int grid, int row, int col, bool selected) { static void draw_grid(void) { clear(); + AppState state = dispatcher_get_state(); + if (zoom_mode) { // Draw grid selector overview attron(A_BOLD); @@ -864,8 +866,6 @@ static void draw_grid(void) { } } - AppState state = dispatcher_get_state(); - for (int row = 0; row < GRID_ROWS; row++) { for (int col = 0; col < GRID_COLS; col++) { bool selected = (row == selected_row && col == selected_col);