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.11k stars 173 forks source link

29d1bb8 broke "open_with_trouble" functionality #477

Closed bellini666 closed 1 month ago

bellini666 commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.11.0-dev-3317+ga9c89bcbf-Homebrew

Operating system/version

MacOS 14.5

Describe the bug

After upgrading to https://github.com/folke/trouble.nvim/commit/29d1bb81adc847e89ddbbf5b11ff0079daf7cc0a, open_with_trouble from telescope is empty.

I tried older commits and that one is the first one presenting the issue.

Here is my trouble config for reference: https://github.com/bellini666/dotfiles/blob/master/vim/lua/plugins.lua#L78

Steps To Reproduce

  1. Use the latest version in main with my config
  2. Search something with trouble
  3. Use open_with_trouble functionality

Expected Behavior

Results to appear on trouble

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

vim.cmd.colorscheme("tokyonight")
-- add anything else here
bellini666 commented 1 month ago

Did not provide a MRE as I'm in a hurry here, but can do later in case the cause is not obvious

folke commented 1 month ago

Have you tried reading the trouble docs? There's literally a section on Telescope in there....

bellini666 commented 1 month ago

Have you tried reading the trouble docs? There's literally a section on Telescope in there....

Hey @folke ,

Sorry, I think in a hurry the issue was not properly explained.

I know how to open with telescope (using it exactly as documented) and I have been using it for ages. The specific commit I linked here broke it. If I revert to the commit before that it works fine.

I can make a video later showing what is happening, but in short trouble opens but the results appear empty

b0ae989c commented 1 month ago

Maybe related to commit 4eaaf9cf8b967010998ccfc4af525b3e6d70b8b5

bellini666 commented 1 month ago

Maybe related to commit 4eaaf9c

Not sure. I bisect the issue to the specific commit that I linked here.

Taking a quick look at it it doesn't make sense, but checking out the exact previous version, which does also contain that change you linked here, makes it still work fine (e.g. I'm using 13ad95902cf479b0fa091a77368af0e03b486fe3 locally to continue working until I can take a better look)

folke commented 1 month ago

ok, sorry, didn't read that correctly.

Probably your deafult fold settings? I'll see to revert that commit and do it differently

bellini666 commented 1 month ago

ok, sorry, didn't read that correctly.

Probably your deafult fold settings? I'll see to revert that commit and do it differently

Np 😊

And regarding default fold settings, not sure... I have vim.opt.foldenable = false in my options as I don't like folds.

Let me know if you want me to try something locally here. I'll also try some options and let you know if I discover anything...

folke commented 1 month ago

I think I was able to fix it. Would be great if you can confirm!

bellini666 commented 1 month ago

I think I was able to fix it. Would be great if you can confirm!

Tested it, the error is still there :(

I don't know if this will be helpful, but this is a video of the issue happening:

https://github.com/folke/trouble.nvim/assets/134025/b48b4b64-0672-47bf-9ad0-4200fa900776

This is a video of the same reproduction but forcing lazy to install https://github.com/folke/trouble.nvim/commit/13ad95902cf479b0fa091a77368af0e03b486fe3 (the commit before the broken one)

https://github.com/folke/trouble.nvim/assets/134025/130c5d2f-695a-46a8-8381-3e96e774c1d0

Let me know if that doesn't help and I'll try to create the MRE

folke commented 1 month ago

My bad, can you check again?

bellini666 commented 1 month ago

My bad, can you check again?

Fixed now! :)

Thanks folke!