bug: cmdline popupmenu completions (cmp backend) stop working after the first time
Did you check docs and existing issues?
- [X] I have read all the noice.nvim docs
- [X] I have updated the plugin to the latest version before submitting this issue
- [X] I have searched the existing issues of noice.nvim
- [X] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.10.1
Operating system/version
Linux, Ubuntu
Describe the bug
Using the "cmp" backend for the popupmenu only works the first time, in subsequent attempts it simply does not show up.
https://github.com/user-attachments/assets/7f6828e9-0033-4585-9a83-240c3e5de21b
{
"folke/noice.nvim",
opts = {
cmdline = {
view = "cmdline",
enabled = true,
},
messages = {
enabled = true,
},
popupmenu = {
enabled = true,
backend = "cmp"
}
},
I am also using LazyVim (somewhat heavily modified), but I was able to reproduce - see bellow
Steps To Reproduce
- Type a command and press TAB
- It should work
- Press ESC to exit (or choose a command)
- Repeat, type a command, this time TAB does nothing.
Expected Behavior
The completion menu opens again, just like it does with the nui backend
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
{ "hrsh7th/nvim-cmp", opts = {} },
{ "folke/noice.nvim", opts = {
cmdline = {
view = "cmdline",
enabled = true,
},
messages = {
enabled = true,
},
popupmenu = {
enabled = true,
backend = "cmp"
}
}
},
},
})
+1
+1
+1 to this as well
Also experiencing this on windows
same
For temporary solution, I modified keymap.listen function in ~/.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/keymap.lua as follows:
---Register keypress handler.
keymap.listen = function(mode, lhs, callback)
if mode == 'c' and lhs == '<Tab>' then
return
end
-- Original implementation continues
end
I hope that helps
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Still relevant - the behavior has changed slightly, but the "cmp" backend is still not working. I get:
Still relevant - the behavior has changed slightly, but the "cmp" backend is still not working. I get:
I guess your error is because of noice using blink.cmp instead of nvim.cmp as its new backend, and you are still using a config like backend=cmp.
Instead, you can simply use this config to have a traditional cmdline view:
{
"folke/noice.nvim",
opts = {
presets = {
command_palette = false,
},
cmdline = {
view = "cmdline",
},
},
}
}
@Welkin-Y Actually with a quick test, it looks to me like the issue is still there:
The following config works, that is not new:
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
{ "hrsh7th/nvim-cmp", opts = {} },
{
"folke/noice.nvim",
opts = {
presets = {
command_palette = false,
},
cmdline = {
view = "cmdline",
},
}
},
},
})
Expected behavior
The behavior I expect is a "default-style" completion popup next to the cursor:
Neither with cmp or blink (which currently appears not supported). So at least backend = "cmp" should be removed from the docs if support is not planned.
@druskus20 Thanks for sharing. I just tested with the latest noice and lazyvim version and it worked pretty well.
For the latest version, you can also omit { "hrsh7th/nvim-cmp", opts = {} },, since nvim-cmp has been replaced.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
