hrsh7th / cmp-cmdline

nvim-cmp source for vim's cmdline
MIT License
493 stars 42 forks source link

bug(cmdheight=0): every keypress causes the statusline to be redrawn #65

Closed akinsho closed 1 year ago

akinsho commented 1 year ago

Since https://github.com/neovim/neovim/pull/20249 was merged it appears that cmdheight=0 now behaves better but one interaction that seems to now be buggy is that using cmp-cmdline causes the statusline to redraw on every keypress. I think this was probably initially by design, but with the new behaviour of neovim nightly it seems that the intention is that the statusline is now replaced by the cmdline when you enter command mode. So I think that cmp cmdline should no longer trigger a redraw

This can be reproduced using

vim.cmd.packadd("nvim-cmp")
vim.cmd.packadd("cmp-cmdline")

vim.o.cmdheight = 0

local cmp = require("cmp")
cmp.setup.cmdline(":", {
    sources = cmp.config.sources({
        { name = "cmdline", keyword_pattern = [=[[^[:blank:]\!]*]=] },
    }),
})

Then open neovim with nvim -u <config-above>

https://user-images.githubusercontent.com/22454918/191720806-b9a9d3e6-1fae-486f-b354-55a1826a86dc.mov

akinsho commented 1 year ago

Actually this might be a bug https://github.com/neovim/neovim/issues/20281 I guess redraw should not hide the cmdline maybe 🤷🏿‍♂️ will close this out and see if fixing that issue resolves this