From cf4299696742eb665da1af36e1db798506256af3 Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Sat, 2 May 2026 22:58:55 +0000 Subject: [PATCH] feat: add border to fuzzy search dialog Co-authored-by: aider (deepseek/deepseek-coder) --- tui.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tui.c b/tui.c index 912d1d0..727d48f 100644 --- a/tui.c +++ b/tui.c @@ -287,20 +287,21 @@ static void draw_fuzzy_search(void) { int width = COLS / 2; int height = LINES / 3; - // Draw border - for (int y = start_y - 1; y <= start_y + height; y++) { - for (int x = start_x - 1; x <= start_x + width; x++) { - mvaddch(y, x, ' '); - } - } + // Create a temporary window for the border + WINDOW *win = newwin(height + 2, width + 2, start_y - 1, start_x - 1); + if (!win) return; + wclear(win); + box(win, 0, 0); + wrefresh(win); + delwin(win); - // Draw title + // Draw title (inside the border) attron(A_BOLD); - mvprintw(start_y - 1, start_x, "%s", fuzzy_search.prompt); + mvprintw(start_y, start_x, "%s", fuzzy_search.prompt); attroff(A_BOLD); // Draw search box - mvprintw(start_y, start_x, "> %s", fuzzy_search.query); + mvprintw(start_y + 1, start_x, "> %s", fuzzy_search.query); // Draw results for (int i = 0; i < height - 2 && i < fuzzy_search.num_results; i++) { @@ -311,7 +312,7 @@ static void draw_fuzzy_search(void) { int count; const char **plugins = carla_get_available_plugins(NULL, &count); if (plugins && idx >= 0 && idx < count) { - mvprintw(start_y + 1 + i, start_x, "%s", plugins[idx]); + mvprintw(start_y + 2 + i, start_x, "%s", plugins[idx]); } if (i == fuzzy_search.selected_index) { attroff(A_REVERSE);