Skip to content

Commit

Permalink
fix: account for cmdheight in cmdline_position (thanks @lnrds!)
Browse files Browse the repository at this point in the history
Closes #538
  • Loading branch information
Saghen committed Dec 13, 2024
1 parent ec9b71c commit 6b67d16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion lua/blink/cmp/config/completion/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6b67d16

Please sign in to comment.