folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
Apache License 2.0
4.29k stars 100 forks source link

bug: using classic mode for cmdline still have completion window floating middle of the screen #846

Closed dhruvinsh closed 3 months ago

dhruvinsh commented 3 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.0

Operating system/version

MacOS 11.5

Describe the bug

When command mode set to classic, completion floating appear middle of the screen.

image

Steps To Reproduce

  1. set cmdline view mode to cmdline
  2. type any command and hit tab
  3. completion will be in the floating window.

Expected Behavior

Completion floating menu should have automatically appear bottom left corner where the command is.

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",
    opts = {
      cmdline = { view = "cmdline" }
    },
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
b0ae989c commented 3 months ago

This is not a bug. Your config does not work, since the dependency MunifTanjim/nui.nvim is missing. noice works as expected for Neovim v0.10.0 on macOS. Should close.

Screenshot 2024-06-11 at 2 36 09 AM with the following config

local root = vim.fn.fnamemodify("./.repro", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
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)
vim.opt.incsearch = false
local plugins = {
    "folke/tokyonight.nvim",
    {
        "folke/noice.nvim",
        dependencies = {
            "MunifTanjim/nui.nvim",
        },
        opts = {
            cmdline = { view = "cmdline" },
        },
    },
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
dhruvinsh commented 3 months ago

Thanks @b0ae989c for point it out. And my bad that I haven't provided proper reproducible config. In my main system I am using Lazyvim, so I am pretty sure that nui is present. And I do not see the same behaviour. I will get the bare reproducible config and report there since noice on its own work fine.

Edit: while writing minimal Lazyvim config I realized the I have to set command_palette to false else it would not work.

Edit2: command_palette = true, -- position the cmdline and popupmenu together

this wording seems incorrect here.