From 6b67d16036b780f49e44d3f5de207d3c7301f3e4 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Fri, 13 Dec 2024 13:19:27 -0500 Subject: [PATCH] fix: account for cmdheight in cmdline_position (thanks @lnrds!) Closes #538 --- README.md | 3 ++- lua/blink/cmp/config/completion/menu.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f47cbee7..efd0796a 100644 --- a/README.md +++ b/README.md @@ -389,7 +389,8 @@ MiniDeps.add({ local pos = vim.g.ui_cmdline_pos -- (1, 0)-indexed return { pos[1] - 1, pos[2] } end - return { vim.o.lines - 1, 0 } + local height = (vim.o.cmdheight == 0) and 1 or vim.o.cmdheight + return { vim.o.lines - height, 0 } end, -- Controls how the completion items are rendered on the popup window diff --git a/lua/blink/cmp/config/completion/menu.lua b/lua/blink/cmp/config/completion/menu.lua index 67e73ab2..64c5ba0e 100644 --- a/lua/blink/cmp/config/completion/menu.lua +++ b/lua/blink/cmp/config/completion/menu.lua @@ -47,7 +47,8 @@ local window = { local pos = vim.g.ui_cmdline_pos -- (1, 0)-indexed return { pos[1] - 1, pos[2] } end - return { vim.o.lines - 1, 0 } + local height = (vim.o.cmdheight == 0) and 1 or vim.o.cmdheight + return { vim.o.lines - height, 0 } end, -- Controls how the completion items are rendered on the popup window