Skip to content

bug: command-line completion errors if 'Trouble' command is abbreviated #580

@LunarLambda

Description

@LunarLambda

Did you check docs and existing issues?

  • I have read all the trouble.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of trouble.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.11.0-dev-825+gd831392b1

Operating system/version

Arch Linux

Describe the bug

Typing :Trouble <tab> triggers completion as expected. Typing :Tr <tab> (i.e. the shortest unique prefix of Trouble, typing :Tr<tab> completes :Trouble), then the following error is thrown:

E5108: Error executing Lua function: ...are/nvim/lazy/trouble.nvim/lua/trouble/config/parser.lua:23: attempt to index local 'input' (a nil value)
stack traceback:
        ...are/nvim/lazy/trouble.nvim/lua/trouble/config/parser.lua:23: in function 'parse'
        ...cal/share/nvim/lazy/trouble.nvim/lua/trouble/command.lua:86: in function 'parse'
        ...cal/share/nvim/lazy/trouble.nvim/lua/trouble/command.lua:12: in function <...cal/share/nvim/lazy/trouble.nvim/lua/trouble/command.lua:10>

Steps To Reproduce

Type :Tr <tab>

Expected Behavior

Completion should work even if an abbreviated prefix of the command is used.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/trouble.nvim", opts = {} },
    -- add any other plugins here
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleThis issue or PR has been inactive for a while

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions