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

Support for nvim-cmp cmdline completion #161

Open
resurrexi opened this issue Dec 12, 2024 · 0 comments
Open

Support for nvim-cmp cmdline completion #161

resurrexi opened this issue Dec 12, 2024 · 0 comments

Comments

@resurrexi
Copy link

Will there be support to include cmdline registration for nvim-cmp? As of now, if I try to run :Dbee open, I will get an error:

Error executing vim.schedule lua callback: Vim:E5108: Error executing Lua function: vim/shared.lua:0: t: expected table, got nil
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        vim/shared.lua: in function <vim/shared.lua:0>
        [C]: in function 'getcompletion'
        ...cal/share/nvim/lazy/cmp-cmdline/lua/cmp_cmdline/init.lua:136: in function 'exec'
        ...cal/share/nvim/lazy/cmp-cmdline/lua/cmp_cmdline/init.lua:202: in function 'complete'
        ...lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/source.lua:341: in function 'complete'
        ...s/lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:308: in function 'complete'
        ...s/lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:178: in function 'autoindent'
        ...s/lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:170: in function 'on_change'
        ...s/lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/init.lua:366: in function 'callback'
        .../.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/async.lua:165: in function <.../.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/async.lua:163>
stack traceback:
        [C]: in function 'getcompletion'
        ...cal/share/nvim/lazy/cmp-cmdline/lua/cmp_cmdline/init.lua:136: in function 'exec'
        ...cal/share/nvim/lazy/cmp-cmdline/lua/cmp_cmdline/init.lua:202: in function 'complete'
        ...lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/source.lua:341: in function 'complete'
        ...s/lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:308: in function 'complete'
        ...s/lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:178: in function 'autoindent'
        ...s/lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:170: in function 'on_change'
        ...s/lyang/.local/share/nvim/lazy/nvim-cmp/lua/cmp/init.lua:366: in function 'callback'
 Dbee 󰀫 .../.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/async.lua:165: in function <.../.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/async.lua:163>

I found the only way to prevent this error from popping up is to ignore Dbee command when setting up nvim-cmp. E.g.

cmp.setup.cmdline(":", {
  sources = {
    {name = "path"},
    {
      name = "cmdline",
      option = {
        ignore_cmds = {
          "Man", -- default
          "!", -- default
          "Dbee" -- ignore due to errors being triggered for this plugin
        }
      }
    }
  }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant