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.39k stars 175 forks source link

bug v3: trouble.open runs error in telescope #393

Closed ShiChenCong closed 5 months ago

ShiChenCong commented 5 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.0-dev-2663+gc1c6c1ee1

Operating system/version

14.2.1 (23C71)

Describe the bug

image

Steps To Reproduce

  1. telescope config
    
    local telescope = require("telescope")

telescope.setup({ defaults = { mappings = { i = { [""] = trouble.open }, n = { [""] = trouble.open }, }, }, })

2. trouble config

require('trouble').setup({ })


3. select multiple file,cause the error
<img width="1436" alt="image" src="https://github.com/folke/trouble.nvim/assets/22486446/b142fc89-5121-430e-99dd-5ac4ada2e824">

### Expected Behavior

not show error

### Repro

_No response_
folke commented 5 months ago

My bad, the code example was wrong. Just updated the docs. Should be sources instead of source

local trouble = require("trouble.sources.telescope")

local telescope = require("telescope")

telescope.setup({
  defaults = {
    mappings = {
      i = { ["<c-t>"] = trouble.open },
      n = { ["<c-t>"] = trouble.open },
    },
  },
})
ShiChenCong commented 5 months ago

I had already used sources before commit this issue

local trouble = require("trouble.sources.telescope")

same error

folke commented 5 months ago

Are you sure that trouble variable is the one pointing to require("trouble.sources.telescope") and not to require("trouble")?

ShiChenCong commented 5 months ago

yes, https://github.com/ShiChenCong/.dotfiles/blob/4ea1d1a61542e4f9603fc58bb789139170a42cc2/nvim/lua/conf/telescope.lua#L4

folke commented 5 months ago

What is the full traceback from your screenshot?

ShiChenCong commented 5 months ago
  1. select multiple file in telescope window
  2. press <a-q> which is executing trouble.open
  3. show the error
folke commented 5 months ago

Still works for me. What is the full stacktrace?

folke commented 5 months ago

Are you using the latest trouble version?

folke commented 5 months ago

Was able to reproduce. Should be fixed now!

ShiChenCong commented 5 months ago

I have just created the minimal reproduce repo 😂 After update, It works perfectly, Thank you for the work!