[X] I have searched the existing issues of trouble.nvim
[X] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.10.0
Operating system/version
WSL 2.0.14.0
Describe the bug
When I set open_no_results to false (which should be the default), it should presumably not "open the trouble window when there are no results". However, the trouble window still opens when I use the Trouble command, specifically with lsp_references (though the same behavior seems to apply with other modes). Similarly, there appears to be no warning when warn_no_results is set to true.
When I set auto_close to true, the trouble window will open, then immediately close.
Perhaps I am misunderstanding the meaning of a "result" versus an "item". I'd like the trouble command to do nothing when there are no references under the cursor.
Steps To Reproduce
Move cursor to an area where there are no lsp references
-- 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",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10.0
Operating system/version
WSL 2.0.14.0
Describe the bug
When I set open_no_results to false (which should be the default), it should presumably not "open the trouble window when there are no results". However, the trouble window still opens when I use the Trouble command, specifically with lsp_references (though the same behavior seems to apply with other modes). Similarly, there appears to be no warning when warn_no_results is set to true.
When I set auto_close to true, the trouble window will open, then immediately close.
Perhaps I am misunderstanding the meaning of a "result" versus an "item". I'd like the trouble command to do nothing when there are no references under the cursor.
Steps To Reproduce
Expected Behavior
Should not open the trouble window.
Repro