Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Trouble QF list not working as intended #592

Open
4 tasks done
rijulkap opened this issue Oct 22, 2024 · 1 comment
Open
4 tasks done

bug: Trouble QF list not working as intended #592

rijulkap opened this issue Oct 22, 2024 · 1 comment
Labels
bug Something isn't working stale

Comments

@rijulkap
Copy link

rijulkap commented Oct 22, 2024

Did you check docs and existing issues?

  • I have read all the trouble.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of trouble.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.10.2

Operating system/version

Windows 11

Describe the bug

The trouble qflist does not seem to be working as intended. This wasn't the case from memory as I dont use this feature too often, but the last time i did i was on 0.10.0.
Opening a qflist using the vim command ':Trouble qflist open' throws an error ( No results for qflist Buffer: path/to/file/in/buffer).
However, weirdly, opening telescope results using Trouble seems to be working fine, i.e. it opens the results as expected. That being said, using ':Trouble qflist close' does nothing to this now open window, throwing the same error.

Similar errors are seen when using the loclist and lsp windows (lsp fails even when a buffer with a configured lsp displaying lsp diagnostics is opened).

The diagnostics and symbol windows seem to working as expected.

Steps To Reproduce

  1. Open a new buffer
  2. Use any of the following commands
  • :Trouble qflist open
  • :Trouble loclist open
  • :Trouble lsp toggle focus=false win.position=right

Expected Behavior

Should open the trouble qflist / loclist / lsp windows

Repro

return {
  {
    'folke/trouble.nvim',
    opts = {},
    cmd = 'Trouble',
    config = function(_, opts)
      require('trouble').setup(opts)
    end,
    keys = {
      {
        '<leader>xx',
        '<cmd>Trouble diagnostics toggle<cr>',
        desc = 'Diagnostics (Trouble)',
      },
      {
        '<leader>xX',
        '<cmd>Trouble diagnostics toggle filter.buf=0<cr>',
        desc = 'Buffer Diagnostics (Trouble)',
      },
      {
        '<leader>cs',
        '<cmd>Trouble symbols toggle focus=false<cr>',
        desc = 'Symbols (Trouble)',
      },
      {
        '<leader>cl',
        '<cmd>Trouble lsp toggle focus=false win.position=right<cr>',
        desc = 'LSP Definitions / references / ... (Trouble)',
      },
      {
        '<leader>xL',
        '<cmd>Trouble loclist toggle<cr>',
        desc = 'Location List (Trouble)',
      },
      {
        '<leader>xQ',
        '<cmd>Trouble qflist toggle<cr>',
        desc = 'Quickfix List (Trouble)',
      },
      {
        '<c-k>',
        function()
          if require('trouble').is_open() then
            require('trouble').prev { skip_groups = true, jump = true }
          else
            local ok, err = pcall(vim.cmd.cprev)
            if not ok then
              vim.notify(err, vim.log.levels.ERROR)
            end
          end
        end,
        desc = 'Previous Trouble/Quickfix Item',
      },
      {
        '<c-j>',
        function()
          if require('trouble').is_open() then
            require('trouble').next { skip_groups = true, jump = true }
          else
            local ok, err = pcall(vim.cmd.cnext)
            if not ok then
              vim.notify(err, vim.log.levels.ERROR)
            end
          end
        end,
        desc = 'Next Trouble/Quickfix Item',
      },
    },
  },
}
@rijulkap rijulkap added the bug Something isn't working label Oct 22, 2024
Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant