noice.nvim
noice.nvim copied to clipboard
misplaced completion window for certain commands
Describe the bug The completion window for commandline is at the wrong place with some commands (lowercase ones?).
Which version of Neovim are you using? NVIM v0.9.0-dev-77-gf175ca9f7
To Reproduce Steps to reproduce the behavior:
-
nvim --clean -u minimal_noice.lua
-
:Pack<tab>
-
:checkhe<tab>
Screenshots
Odd is that here there is an empty line between commandline and window which isn't the case with my normal config. But the bug is the same.
`minimal_noice.lua`
```lua vim.cmd([[set runtimepath=$VIMRUNTIME]]) vim.cmd([[set packpath=/tmp/nvim/site]]) local package_root = "/tmp/nvim/site/pack" local install_path = package_root .. "/packer/start/packer.nvim" local function load_plugins() require("packer").startup({ { "wbthomason/packer.nvim", { "folke/noice.nvim", requires = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify", }, }, }, config = { package_root = package_root, compile_path = install_path .. "/plugin/packer_compiled.lua", display = { non_interactive = true }, }, }) end _G.load_config = function() vim.o.lazyredraw = false require("noice").setup({ cmdline = { enabled = true, ---@type tableformat = { search_down = { kind = "Search", pattern = "^/", lang = "regex", view = "cmdline", }, inspect = { conceal = true, icon = " ", lang = "lua", pattern = "^:%s*lua =%s*", -- icon=" " }, }, }, popupmenu = { enabled = true, ---@type 'nui'|'cmp' backend = "nui", }, notiy = { enabled = true, }, messages = { enabled = true, }, lsp = { hover = { enabled = true, }, progress = { enabled = false, }, signature = { enabled = true, }, message = { enabled = true, }, override = { -- override the default lsp markdown formatter with Noice ["vim.lsp.util.convert_input_to_markdown_lines"] = true, -- override the lsp markdown formatter with Noice ["vim.lsp.util.stylize_markdown"] = true, }, }, views = { cmdline_popup = { position = { row = -2, col = "50%", }, size = { width = math.floor(vim.o.columns * 0.9), height = "auto", }, win_options = { conceallevel = 0, }, }, popupmenu = { -- relative = "editor", position = { row = -5, col = "50%", }, size = { width = math.floor(vim.o.columns * 0.9), height = 10, }, border = { style = "rounded", padding = { 0, 1 }, }, win_options = { winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo", }, }, }, }, routes = { { filter = { event = "msg_show", kind = "", find = "written", }, opts = { skip = true }, }, }, }) end if vim.fn.isdirectory(install_path) == 0 then print("Installing plugins and dependencies.") vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path, }) end load_plugins() require("packer").sync() vim.cmd( [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]] ) ```
I found some other cases where it fails (this is without minimal config now):
:T<tab>
:TS<tab>
Interesting to see that it's at different places than in previous screenshots
Try disabling smart_move
doesn't seem to fix it
it might has something to do with the negative numbers for the positions before I used positive ones and never had similar problems now I tried using absolute ones again and none of the issues above occured I'll have to see if I find a way to do it without negative ones
it's fixable with e.g. vim.o.lines-3
perhaps that could be internally when negative numbers are used?
It wasnt mentioned anywhere that negative numbers would work, so would have been very useful to mention that when opening an issue. Or not opening an issue at all since it's not documented anywhere.
Either way, I'll add support for this.
My apologies. Apparently I had previously already implemented negative offsets 😄 Will look into it further!
Should be fixed now!