folke / trouble.nvim

🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Apache License 2.0
5.63k stars 177 forks source link

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

Open LunarLambda opened 2 months ago

LunarLambda commented 2 months ago

Did you check docs and existing issues?

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
  },
})
github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

LunarLambda commented 1 month ago

not resolved yet