Skip to content

bug: "Error E5248: Invalid character in group name" with completions #453

@albertfgu

Description

@albertfgu

Did you check docs and existing issues?

  • I have read all the noice.nvim docs
  • I have searched the existing issues of noice.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.8.1

Operating system/version

MacOS 13.3.1

Describe the bug

Summary:
When Noice is used together with https://github.com/lervag/vimtex, which provides an extensive omnicompletion, an error "Error E5248: Invalid character in group name" appears for each completion candidate.

Buggy behavior:

With the following lazy.nvim spec, the error occurs (see screenshot)

    {
      "folke/noice.nvim",
      opts = {},
    },
    { "MunifTanjim/nui.nvim" },
    { "lervag/vimtex" },

image

Correct behavior:
Disabling the popupmenu fixes the issue. Removing the opts table entirely also fixes the issue.

    {
      "folke/noice.nvim",
      opts = {
        popupmenu = {
          enabled = false, -- enables the Noice popupmenu UI
          ---@type 'nui'|'cmp'
          backend = "nui", -- backend to use to show regular cmdline completions
          ---@type NoicePopupmenuItemKind|false
          kind_icons = false, -- setting this to `false` by itself does not fix the issue
        },
      },
    },
    { "MunifTanjim/nui.nvim" },
    { "lervag/vimtex" },

image

Additional context:
I asked in the Gitter and @clason had the following comment: "VimTeX provides word, abbrv, and menu, which noice may not expect".

Steps To Reproduce

  1. Use the below repro.lua
  2. nvim -u repro.lua repro.tex
  3. Type i\<C-x><C-o> (i.e. type a leading \ and enter omnicompletion) to trigger the error.

(Note: a repro.tex file is not provided because this is an empty file on purpose, which was used to generate the above screenshots)

Expected Behavior

See above

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 = {} },
  { "MunifTanjim/nui.nvim" },
  { "lervag/vimtex" },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions