fix: move state declaration before first use in draw_grid

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-03 18:50:47 +00:00
parent 5f1cc081f7
commit 599afd748e

4
tui.c
View File

@@ -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);