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.12k stars 172 forks source link

bug v3: missing Trouble commands #422

Closed illya-laifu closed 2 months ago

illya-laifu commented 2 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9.5 Release

Operating system/version

EndeavorOS x86_64

Describe the bug

Editor shows an error Not an editor command: Trouble when executing Trouble from command mode, the command is not listed in :commands

Steps To Reproduce

  1. Execute :Trouble, :Trouble diagnostics toggle, etc.

Expected Behavior

Visible Trouble buffer.

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/trouble.nvim", branch = "dev" },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
illya-laifu commented 2 months ago

Found the issue. Adding opts = {} or manually calling .setup() registers the commands. I was under (wrong) assumption, that omitting opts would fallback to the default config.