Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
albertfgu opened this issue May 4, 2023 · 4 comments · Fixed by #451 or #639
Closed
3 tasks done

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

albertfgu opened this issue May 4, 2023 · 4 comments · Fixed by #451 or #639
Labels
bug Something isn't working

Comments

@albertfgu
Copy link

albertfgu commented May 4, 2023

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
@albertfgu albertfgu added the bug Something isn't working label May 4, 2023
@folke folke closed this as completed in 0b86a7b May 4, 2023
@folke
Copy link
Owner

folke commented May 4, 2023

Should be fixed now. Would be great if you could confirm.

The problem was that vimtex returns non-standard item kinds that have non-word characters in them.

@clason
Copy link

clason commented May 4, 2023

non-standard item kinds

Depends on your definition of "letter", surely ;)

@albertfgu
Copy link
Author

I checked and it's indeed fixed. Thanks for the quality work and fast response as always!

@folke
Copy link
Owner

folke commented May 4, 2023

@clason ok, it was actually me expecting kinds to be kind as part of a hl group name :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants