aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2025-11-10 07:07:25 +0800
committerGitHub <noreply@github.com>2025-11-10 07:07:25 +0800
commit76fdd9b882489b233ca00a0809d719c70e48b164 (patch)
treee07894783bbfa9bf24fd6bec2100ad11efc9c4f9 /src
parenta0678a5849d346788767b33c09f1b657a06e77c5 (diff)
downloadrneovim-76fdd9b882489b233ca00a0809d719c70e48b164.tar.gz
rneovim-76fdd9b882489b233ca00a0809d719c70e48b164.tar.bz2
rneovim-76fdd9b882489b233ca00a0809d719c70e48b164.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/popupmenu.c3
1 files changed, 2 insertions, 1 deletions
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);