Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmdline position doesn't account for cmdline height #538

Closed
2 tasks done
lnrds opened this issue Dec 13, 2024 · 0 comments
Closed
2 tasks done

cmdline position doesn't account for cmdline height #538

lnrds opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working cmdline Related to the command line

Comments

@lnrds
Copy link

lnrds commented Dec 13, 2024

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

completion.menu.cmdline_position works correctly with vim.o.cmdline=1 or vim.o.cmdheight=0 but covers the prompt with higher vim.o.cmdheight values.
Changin

return { vim.o.lines - 1, 0 }

to

local height = (vim.o.cmdheight == 0) and 1 or vim.o.cmdheight
return { vim.o.lines - height, 0 }

should help.

Relevant configuration

completion = {
    menu = {
        cmdline_position = function()
            if vim.g.ui_cmdline_pos ~= nil then
                local pos = vim.g.ui_cmdline_pos -- (1, 0)-indexed
                return { pos[1] - 1, pos[2] }
            end
            return { vim.o.lines - 1, 0 }
        end,
    },
}

neovim version

NVIM v0.11.0-dev-1321+gfe1e2eff06 Build type: RelWithDebInfo LuaJIT 2.1.1732813678

blink.cmp version: branch, tag, or commit

54d1a98

@lnrds lnrds added the bug Something isn't working label Dec 13, 2024
@Saghen Saghen closed this as completed in 6b67d16 Dec 13, 2024
@Saghen Saghen added the cmdline Related to the command line label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmdline Related to the command line
Projects
None yet
Development

No branches or pull requests

2 participants