noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

bug: nui autocomplete menu for cmdline does not persist and update like cmp backend

Open theKnightsOfRohan opened this issue 9 months ago • 1 comments

Did you check docs and existing issues?

  • [X] I have read all the noice.nvim docs
  • [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)

0.9.5 release

Operating system/version

macOS Sonoma 14.4.1

Describe the bug

When using the nui backend for the preset cmdline popup, you can press <C-d> on the cmdline menu to show the list of all the commands you can run, and navigate it with <Tab> and <S-Tab>, like normal. However, ass soon as you type a letter, the popup disappears. Note that the cmp backend functions as intended, it's only the nui backend which does not work.

Steps To Reproduce

  1. Open cmdline using :
  2. Press <C-d> to open popup menu
  3. Use <Tab> and <S-Tab> and see that they work as intended
  4. Type any letter and see that the popupmenu disappears.

Expected Behavior

I would expect the nui backend cmdline popup to work the same way as cmp, where typing after the popupmenu has been opened will not make it disappear, but rather update its contents.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
    "folke/tokyonight.nvim",
    "folke/noice.nvim",
    -- add any other plugins here
    -- both backend plugins added for comparison purposes
    "MunifTanjim/nui.nvim",
    "hrsh7th/nvim-cmp",
}

require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

require("noice").setup({
    popupmenu = {
        backend = "nui",
    },
    presets = {
        command_palette = true,
    },
})

theKnightsOfRohan avatar May 13 '24 15:05 theKnightsOfRohan