From 76fdd9b882489b233ca00a0809d719c70e48b164 Mon Sep 17 00:00:00 2001 From: glepnir Date: Mon, 10 Nov 2025 07:07:25 +0800 Subject: fix(pum): crash when resizing grid with pumborder set (#36404) Problem: Grid size check didn't account for border_width, causing row index out of bounds when drawing bordered popup menu. Solution: Check grid.rows against pum_height + border_width. --- src/nvim/popupmenu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c index f182744631..3b96ebda00 100644 --- a/src/nvim/popupmenu.c +++ b/src/nvim/popupmenu.c @@ -660,7 +660,8 @@ void pum_redraw(void) pum_invalid = false; must_redraw_pum = false; - if (!pum_grid.chars || pum_grid.rows != pum_height || pum_grid.cols != grid_width) { + if (!pum_grid.chars || pum_grid.rows != pum_height + border_width + || pum_grid.cols != grid_width + border_width) { grid_alloc(&pum_grid, pum_height + border_width, grid_width + border_width, !invalid_grid, false); ui_call_grid_resize(pum_grid.handle, pum_grid.cols, pum_grid.rows); -- cgit